CMYKColor

CMYKColor class

Class for CMYK color. A null instance means CMYK is not used, and default RGB color is in use.

new CMYKColor(c, m, y, k)

Initializes a new instance of the CMYKColor class from CMYK values. CMYK values are expected in the range 0–100.

ParameterTypeDescription
cnumber– Cyan value [0, 100]
mnumber– Magenta value [0, 100]
ynumber– Yellow value [0, 100]
knumber– Black value [0, 100]

Methods

NameDescription
parseCMYK(str) (static)Parse a CMYK string of the form “C_M_Y_K” into a CMYKColor instance.
formatCMYK()Format this CMYKColor into a string “C_M_Y_K”, multiplying each internal component (0–1) by 100 and rounding.
toString()Optional: a human-readable representation.