Defining colors
- Last updated on April 13, 2024
- •
- 1 minute to read
When defining colors in Customer's Canvas configuration files or API, you can use the RGB and CMYK color spaces, as well as Lab and spot colors. To learn about the representation of colors on a computer, refer to the Color Spaces article.
RGB Colors
Customer's Canvas supports both RGB and RGBA color models to display products. To define the alpha channel in RGBA, use values in the range [0, 1]
.
"rgb(0, 255, 255)"
"rgba(0,121,0,0.8)"
CMYK Colors
When you have CMYK templates, you may find it important to specify colors in the CMYK color space.
The following example illustrates how you can specify CMYK components and the alpha channel as percentages and values in the range [0, 1]
.
"cmyk(0%, 0%, 100%, 0%, 100%)"
"cmyk(0, 0.9, 0, 0, 1.0)"
Spot Colors
When you print certain products, you may want to limit the colors available to a user by a specific list of values, which correspond to the spot colors of your printer.
To add a spot color to the Color picker, define it in the following format: spot('Color name', altColor, solidity, tint)
. Here, you need to specify the name of the ink, an alternative color for the color preview, a solidity value in the range [0, 1]
, and a tint of the spot color, for example:
"spot(PANTONE Rubine Red C, cmyk(30%,100%,90%,36%,100%), 1, 100%)"
Lab Colors
To add a Lab color, you need to define its components as follows: lab(lightness, a, b, alpha)
. For example:
"lab(62, -44, -50, 50%)"