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
- CColor.getValues()¶
Get the color values.
- Returns
The color values.
The return type depends on the color model obtained by
getModel()
:comet.kColorModelGray
:-
Gray shade in range[0.0, 1.0]
comet.kColorModelRGB
:-
RGB values in range[0, 255]
comet.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
- 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
- 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
- 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
- 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