Beispiel #1
0
        public CmykColor ToCmyk(CmykType type = CmykType.CmyNormalized)
        {
            var color     = ToRgb();//normalize
            var converted = new CmykColor();

            converted.C = 1 - color.r;
            converted.M = 1 - color.g;
            converted.Y = 1 - color.b;

            return(converted.ToCmyk(type));
        }
Beispiel #2
0
        public CmykColor ToCmyk(CmykType type = CmykType.CmyNormalized)
        {
            if (type == Type)
            {
                return(this);
            }
            var color = new CmykColor(type);

            if (type == CmykType.CmykNormalized) //cmk to cmyk
            {
                color.k = Math.Min(Math.Min(c, m), y);
                color.c = c - color.k;
                color.m = m - color.k;
                color.y = y - color.k;
            }
            else //cmyk to cmy
            {
                color.c += k;
                color.m += k;
                color.y += k;
            }

            return(color);
        }
Beispiel #3
0
 public CmykColor(CmykType type = CmykType.CmyNormalized)
 {
     Type = type;
 }
Beispiel #4
0
 public CmykColor ToCmyk(CmykType type = CmykType.CmyNormalized)
 {
     return(ToRgb().ToCmyk(type));
 }