cmyk | R Documentation |
Create a vector of colors from cyan, magenta, yellow, and black
cmyk(c = 0, m = 0.6, y = 0.6, k = 0.4)
c, m, y, k |
color components, numeric vectors with values in |
The first argument can also be a data.frame or a matrix. In that case, its columns are considered as the color components, taken in order, and the other color components arguments are ignored.
When separate arguments are used for the color components and are vectors, values in shorter arguments are recycled to match the length of the longest argument. If the lengths are not compatible, an error is output.
In R (and in chroma) colors are represented internally in the sRGB color space. CMYK is the color model used by printers, which use cyan, magenta, yellow and black ink. The CMYK model and its associated color spaces cannot reproduce all sRGB colors, seen on screens; bright and flashy colors in particular. On the other hand, some CMYK colors are not representable in sRGB; in those cases, they will be converted to the nearest sRGB color. It is therefore possible for two different cmyk
specifications to yield the same sRGB hex code.
A vector of colors specified as hex codes
parse_color
for the general function to parse colors in various specifications (which this function calls internally) and convert_color
to convert parsed colors to another model.
Other color specifications:
css()
,
hcl()
,
hex()
,
hsi()
,
hsl()
,
hsv()
,
lab()
,
parse_color()
,
rgb()
,
ryb()
,
temperature()
,
wavelength()
cmyk() cmyk(0, 0, 0, 0.1) cmyk(data.frame(c(1, 0.5), c(1, 1), c(1, 1), c(0.5, 0.5))) cmyk(matrix(c(1, 0.5, 1, 1, 1, 1, 0.5, 0.5), ncol=4)) cmyk(c=0.5, m=1, y=1, k=c(0.25, 0.5, 0.75)) # Color ramp show_col(cmyk(k=seq(0, 1, length.out=10)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.