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

CColor

Raises
  • TypeError – When parameter types are invalid

  • ValueError – When parameters are out of range

Available

comet.color.createRGB(R=0, G=0, B=0)

Create a CColor object with RGB values.

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

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

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

Returns

The newly created color

Return type

CColor

Raises
  • TypeError – When parameter types are invalid

  • ValueError – When parameters are out of range

Available

comet.color.createCMYK(C=0.0, M=0.0, Y=0.0, K=0.0)

Create a CColor object with CMYK values.

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

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

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

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

Returns

The newly created color

Return type

CColor

Raises
  • TypeError – When parameter types are invalid

  • ValueError – When parameters are out of range

Available

comet.color.createLAB(L=0.0, A=0, B=0)

Create a CColor object with LAB values.

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

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

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

Returns

The newly created color

Return type

CColor

Raises
  • TypeError – When parameter types are invalid

  • ValueError – When parameters are out of range

Available