comet.color¶
The comet.color module provides access to a documents swatches and color settings.
Methods¶
- comet.color.createGray(value=0.0)¶
Create a CColor object with a gray value.
- Parameters:
value (float) – The gray value in range[0.0, 1.0]
- Returns:
The newly created color
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameters are out of range
- Available:
InDesign® comet_pdf® Illustrator®
- Examples:
Create a 50% gray color.
gray = comet.color.createGray(0.5)
- comet.color.createRGB(R=0, G=0, B=0)¶
Create a CColor object with RGB values.
- Parameters:
- Returns:
The newly created color
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameters are out of range
- Available:
InDesign® comet_pdf® Illustrator®
- Examples:
Create a red RGB color.
red = comet.color.createRGB(255, 0, 0)
Create a purple RGB color.
purple = comet.color.createRGB(161, 52, 235)
- comet.color.createCMYK(C=0.0, M=0.0, Y=0.0, K=0.0)¶
Create a CColor object with CMYK values.
- Parameters:
- Returns:
The newly created color
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameters are out of range
- Available:
InDesign® comet_pdf® Illustrator®
- Examples:
Create a green CMYK color.
green = comet.color.createCMYK(0.8, 0.0, 1.0, 0.0)
Create an orange CMYK color.
orange = comet.color.createCMYK(0.0, 0.35, 0.80, 0.0)
- comet.color.createLAB(L=0.0, A=0, B=0)¶
Create a CColor object with LAB values.
- Parameters:
- Returns:
The newly created color
- Return type:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameters are out of range
- Available:
InDesign® comet_pdf® Illustrator®
- Examples:
Create an orange LAB color.
orange = comet.color.createCMYK(76.0, 27, 66)