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

int

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():

Return type

float | tuple[int, int, int] | tuple[float, float, float, float] | tuple[float, int, int]

Raises
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
Available

CColor.setRGB(R, G, B)

Set the color type to RGB and set the values.

Parameters
  • R (int) – Red value in range[0, 255]

  • G (int) – Green value in range[0, 255]

  • B (int) – Blue value in range[0, 255]

Raises
Available

CColor.setCMYK(C, M, Y, K)

Set the color type to CMYK and set the values.

Parameters
  • C (float) – C value in range[0.0, 1.0]

  • M (float) – M value in range[0.0, 1.0]

  • Y (float) – Y value in range[0.0, 1.0]

  • K (float) – K value in range[0.0, 1.0]

Raises
Available

CColor.setLAB(L, A, B)

Set the color type to LAB and set the values.

Parameters
  • L (float) – L value in range[0.0, 100.0]

  • A (int) – A value in range[-127, 128]

  • B (int) – B value in range[-127, 128]

Raises
Available