An CMYK colour object. CMYK (cyan, magenta, yellow, and black) colours are
based on additive percentages of ink. A CMYK colour of (0.3, 0, 0.8, 0.3)
would be mixed from 30% cyan, 0% magenta, 80% yellow, and 30% black.
| Constants |
| PDF_FORMAT_STR |
The format of a DeviceCMYK colour for PDF. In color-tools 2.0 this will be
removed from this package and added back as a modification by the
PDF::Writer package.
|
| Public Attributes |
| c |
|
| k |
|
| m |
|
| y |
|
| Public Methods |
| == |
Compares the other colour to this one. The other colour will be converted
to CMYK before comparison, so the comparison between a CMYK colour and a
non-CMYK colour will be approximate and based on the other colour’s
#to_cmyk conversion. If there is no #to_cmyk conversion, this will raise an
exception. This will report that two CMYK colours are equivalent if all
component values are within 1e-4 (0.0001) of each other.
|
| c= |
|
| from_fraction |
Creates a CMYK colour object from fractional values 0..1.
|
| html |
Present the colour as an RGB HTML/CSS colour string. Note that this will
perform a #to_rgb operation using the default conversion formula.
|
| k= |
|
| m= |
|
| new |
Creates a CMYK colour object from percentages. Internally, the colour is
managed as fractional values 0..1.
|
| pdf_fill |
Present the colour as a DeviceCMYK fill colour string for PDF. This will be
removed from the default package in color-tools 2.0.
|
| pdf_stroke |
Present the colour as a DeviceCMYK stroke colour string for PDF. This will
be removed from the default package in color-tools 2.0.
|
| to_cmyk |
|
| to_grayscale |
Converts the CMYK colour to a single greyscale value. There are undoubtedly
multiple methods for this conversion, but only a minor variant of the Adobe
conversion method will be used:
|
| to_greyscale |
Alias for #to_grayscale
|
| to_hsl |
Converts to RGB then HSL.
|
| to_rgb |
Converts the CMYK colour to RGB. Most colour experts strongly suggest that
this is not a good idea (some even suggesting that it’s a very bad
idea). CMYK represents additive percentages of inks on white paper, whereas
RGB represents mixed colour intensities on a black screen.
|
| to_yiq |
Converts to RGB then YIQ.
|
| y= |
|
<code/>and<pre/>for code samples.