예제 #1
0
        public static int?HueDistanceMili(this ColorORGB o0, ColorORGB o1)
        {
            if (o0 == null || o1 == null)
            {
                return(null);
            }
            ColorHSV o2 = o0.AsHSV();
            ColorHSV o3 = o1.AsHSV();

            return(o2.HueDistanceMili(o3));
        }
예제 #2
0
 public static bool Equals(this ColorORGB o0, ColorORGB o1)
 {
     if (o0 == o1)
     {
         return(true);
     }
     if (o0 == null || o1 == null)
     {
         return(false);
     }
     return(o0.OMilli == o1.OMilli && o0.RMilli == o1.RMilli && o0.GMilli == o1.GMilli && o0.BMilli == o1.BMilli);
 }
예제 #3
0
        public static ColorHSV AsHSV(this ColorORGB color)
        {
            int?rMilli = color.RMilli;
            int?gMilli = color.GMilli;
            int?bMilli = color.BMilli;

            if (!rMilli.HasValue || !gMilli.HasValue || !bMilli.HasValue)
            {
                return(new ColorHSV());
            }
            Bib3.Extension.RGBKonvertiirtNaacHueSatVal(rMilli.Value, gMilli.Value, bMilli.Value, 1000, 1000, out int hue, out int sat, out int val);
            return(new ColorHSV(hue, sat, val));
        }