comet.CColor¶
- class comet.CColor¶
See also
Module color
Methods¶
- CColor.getModel()¶
Get the color model.
- Returns:
The color model.
One of Color models
- Return type:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CColor.getValues()¶
Get the color values.
- Returns:
The color values.
The return type depends on the color model obtained by
getModel()
:constants.kColorModelGray
:-
Gray shade in range[0.0, 1.0]
constants.kColorModelRGB
:-
RGB values in range[0, 255]
constants.kColorModelLAB
:-
LAB values in range[0.0, 100.0] for L and range[-127, 128] for A and B
- Return type:
float | tuple[int, int, int] | tuple[float, float, float, float] | tuple[float, int, int]
- Raises:
TypeError – When the color type is unknown
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CColor.setGray(value)¶
the color type to gray and set the value.
- Parameters:
value (float) – Gray value in range[0.0, 1.0]
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameters are out of range
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CColor.setRGB(R, G, B)¶
Set the color type to RGB and set the values.
- Parameters:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameters are out of range
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CColor.setCMYK(C, M, Y, K)¶
Set the color type to CMYK and set the values.
- Parameters:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameters are out of range
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CColor.setLAB(L, A, B)¶
Set the color type to LAB and set the values.
- Parameters:
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameters are out of range
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
Special methods¶
- CColor.__repr__()¶
String representation.
- Returns:
For
getModel()
==constants.kColorModelRGB
:<CColor> Type: RGB | R: Red | G: Green | B: Blue
For
getModel()
==constants.kColorModelCMYK
:<CColor> Type: CMYK | C: C | M: M | Y: Y | K: K
For
getModel()
==constants.kColorModelLAB
:<CColor> Type: LAB | L: L | A: A | B: B
For
getModel()
==constants.kColorModelGray
:<CColor> Gray: LAB | Gray value
<CColor> RGB | R: 10 | G: 20 | B: 30 <CColor> CMYK | C: 0.30 | M: 0.40 | Y: 0.50 | K: 0.60 <CColor> LAB | L: 20.00 | A: 30 | B: 40 <CColor> Gray | 0.50
- Return type: