Beispiel #1
0
            public void DarkVioletCmykToHsl()
            {
                var knownColor = new Cmyk { C = .29858, M = 1, Y = 0, K = .17255, };
                var expectedColor = new Hsl { H = 282, S = 100, L = 41, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
Beispiel #2
0
            public void DarkVioletCmykToLch()
            {
                var knownColor = new Cmyk { C = .29858, M = 1, Y = 0, K = .17255, };
                var expectedColor = new Lch { L = 39.579, C = 103.828, H = 317.325, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
Beispiel #3
0
            public void DarkVioletCmykToLab()
            {
                var knownColor = new Cmyk { C = .29858, M = 1, Y = 0, K = .17255, };
                var expectedColor = new Lab { L = 39.579, A = 76.336, B = -70.378, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
Beispiel #4
0
            public void DarkVioletCmykToRgb()
            {
                var knownColor = new Cmyk { C = .29858, M = 1, Y = 0, K = .17255, };
                var expectedColor = new Rgb { R = 148, G = 0, B = 211, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
Beispiel #5
0
            public void DarkVioletCmykToXyz()
            {
                var knownColor = new Cmyk { C = .29858, M = 1, Y = 0, K = .17255, };
                var expectedColor = new Xyz { X = 23.970, Y = 10.999, Z = 62.487, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
Beispiel #6
0
            public void WhiteRgbToCmyk()
            {
				var knownColor = new Rgb { R = 255, G = 255, B = 255, };
				var expectedColor = new Cmyk { C = 0, M = 0, Y = 0, K = 0, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
Beispiel #7
0
            public void DarkVioletCmykToCmyk()
            {
                var knownColor = new Cmyk { C = .29858, M = 1, Y = 0, K = .17255, };
                var expectedColor = new Cmyk { C = .29858, M = 1, Y = 0, K = .17255, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
Beispiel #8
0
 public bool Equals(Cmyk other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(other.C == C && other.M == M && other.Y == Y && other.K == K);
 }
 public static T To <T>(this IColorSpaceWithProfile color) where T : class, IColorSpace, new()
 {
     if (color.Color is ICmyk)
     {
         var rgb = ToColor(color.Color as ICmyk, color.Profile);
         return(rgb.To <T>());
     }
     if (typeof(ICmyk).IsAssignableFrom(typeof(T)))
     {
         var rgb  = color.Color.To <Rgb>();
         var item = new Cmyk();
         ToColorSpace(rgb, item, color.Profile);
         return(item as T);
     }
     throw new ArgumentException("Profiles require that you are converting to or from Cmyk.");
 }
Beispiel #10
0
            public void DarkVioletCmykToYxy()
            {
                var knownColor = new Cmyk { C = .29858, M = 1, Y = 0, K = .17255, };
                var expectedColor = new Yxy { Y1 = 10.99, X = .24596, Y2 = .11286, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
Beispiel #11
0
            public void AquamarineHsvToCmyk()
            {
                var knownColor = new Hsv { H = 160, S = .5, V = 1, };
                var expectedColor = new Cmyk { C = .5, M = 0, Y = .16666, K = 0, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
Beispiel #12
0
            public void RivergumXyzToCmyk()
            {
                var knownColor = new Xyz { X = 13.123, Y = 15.372, Z = 13.174, };
                var expectedColor = new Cmyk { C = .1327, M = 0, Y = .16028, K = .55494, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
Beispiel #13
0
            public void GoldenrodRgbToCmyk()
            {
                var knownColor = new Rgb { R = 218, G = 165, B = 32, };
                var expectedColor = new Cmyk { C = 0, M = .24312, Y = .85321, K = .14510, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
Beispiel #14
0
            public void SilverLuvToCmyk()
            {
                var knownColor = new Luv { L = 77.704, U = .001, V = -.013, };
                var expectedColor = new Cmyk { C = .0000148, M = .000, Y = .0000186, K = .24704, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
Beispiel #15
0
            public void SteelBlueCmyToCmyk()
            {
                var knownColor = new Cmy { C = .72549, M = .49020, Y = .29412, };
                var expectedColor = new Cmyk { C = .61111, M = .27778, Y = 0, K = .29412, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
Beispiel #16
0
            public void BlackRgbToCmyk()
            {
                var knownColor = new Rgb { R = 0, G = 0, B = 0, };
                var expectedColor = new Cmyk { C = 0, M = 0, Y = 0, K = 1, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
Beispiel #17
0
            public void AliceBlueHslToCmyk()
            {
                var knownColor = new Hsl { H = 208, S = 100, L = 97, };
                var expectedColor = new Cmyk { C = .06, M = .028, Y = 0, K = 0, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
Beispiel #18
0
            public void MaroonLchToCmyk()
            {
                var knownColor = new Lch { L = 24.829, C = 60.093, H = 38.180, };
                var expectedColor = new Cmyk { C = 0, M = .984, Y = 1, K = .49804, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
Beispiel #19
0
            public void RedLabToCmyk()
            {
                var knownColor = new Lab { L = 53.233, A = 80.109, B = 67.220, };
                var expectedColor = new Cmyk { C = 0.0039, M = .99970, Y = 1, K = 0, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }