comet.CSwatch

class comet.CSwatch

Methods

CSwatch.getDocument()

Returns the document this swatch belongs to.

Returns

The owning document

Return type

CDocument

Available

CSwatch.getName()

Get the swatch name.

The name is not translated and uses the internal host application name.

Returns

The swatch name

Return type

str

Available

CSwatch.getModel()

Get the color model of this swatch if it is a basic color.

Returns

The color model.

One of Color models.

Returns comet.kColorModelUnknown when the color is not a basic color.

Return type

int

Available

CScript

color::get_space

CSwatch.getSpace()

Get the swatch definition space.

Returns

The swatch definition space.

One of Swatch spaces

Return type

int

Available

CScript

color::get_space

CSwatch.getType()

Get the type of this swatch.

Returns

The swatch type.

One of Swatch types

Return type

int

Available

CScript

color::get_type

CSwatch.getTint()

Get the tint of this swatch.

Returns

The swatch tint

Return type

float

Available

CScript

color::get_tint

CSwatch.isSpot()

Get wether this swatch is a spot color.

Returns

Wether the swatch is a spot color

Return type

bool

Available

CScript

color::is_spot

CSwatch.isLocked()

Get wether this swatch is locked.

Returns

Wether the swatch is locked

Return type

bool

Available

CScript

color::is_locked

CSwatch.isReserved()

Get wether this swatch is reserved by the host application.

Returns

Wether the swatch is reserved

Return type

bool

Available

CScript

color::is_reserved

CSwatch.getColor()

Get the color of the swatch.

Returns

The swatch color.

The return type depends on the swatch color model obtained by getModel():

Return type

CColor | None

Available

CScript

color::get_colors

CSwatch.getColors()

Get the color values of the swatch.

Returns

The color values.

The return type depends on the swatch color model:

Return type

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

Available

CScript

color::get_colors

CSwatch.redefine(space, colors, type=1)

Change the definition of this swatch. Type must be comet.kSwatchTypeBaseColor . Please take care not to change reserved swatches. This may cause serious errors!

Parameters
Return type

None

Raises
  • TypeError – When parameter types are invalid

  • ValueError

    • When parameter space has invalid value

    • When parameter colors contains invalid values for the required space

    • When parameter type has invalid value

  • CometError – On internal error

Available

CScript

color::redefine_swatch