Colors

changeColor

changeColor("name", c, m, y, k)

Changes the color "name" to the specified CMYK value. The color value is defined via four components c = Cyan, m = Magenta, y = Yellow and k = Black. Color components should be in the range from 0 to 255. Note : deprecated, use changeColorCMYK() instead.

May raise NotFoundError if the named color wasn't found. May raise ValueError if an invalid color name is specified.

changeColorCMYK

changeColorCMYK("name", c, m, y, k)

Changes the color "name" to the specified CMYK value. The color value is defined via four components c = Cyan, m = Magenta, y = Yellow and k = Black. Color components should be in the range from 0 to 255.

May raise NotFoundError if the named color wasn't found. May raise ValueError if an invalid color name is specified.

changeColorCMYKFloat

changeColorCMYKFloat("name", c, m, y, k)

Changes the color "name" to the specified CMYK value. The color value is defined via four components c = Cyan, m = Magenta, y = Yellow and k = Black. Color components are floating point values between 0 and 100.

May raise NotFoundError if the named color wasn't found. May raise ValueError if an invalid color name is specified.

changeColorLab

changeColorLab("name", r, g, b)

Changes the color "name" to the specified CIELab values. The color value is defined via three components: L = luminosity, a = green/red, b = blue/yellow. Color components are floating point values with L between 0 and 100, a and b between -128 and 128.

May raise NotFoundError if the named color wasn't found. May raise ValueError if an invalid color name is specified.

changeColorRGB

changeColorRGB("name", r, g, b)

Changes the color "name" to the specified RGB value. The color value is defined via three components r = red, g = green, b = blue. Color components should be in the range from 0 to 255.

May raise NotFoundError if the named color wasn't found. May raise ValueError if an invalid color name is specified.

changeColorRGBFloat

changeColorRGBFloat("name", r, g, b)

Changes the color "name" to the specified RGB value. The color value is defined via three components r = red, g = green, b = blue. Color components are floating point values between 0 and 255.

May raise NotFoundError if the named color wasn't found. May raise ValueError if an invalid color name is specified.

defineColor

defineColor("name", c, m, y, k)

Defines a new color "name". The color Value is defined via four components: c = Cyan, m = Magenta, y = Yellow and k = Black. Color components should be in the range from 0 to 255. Note : deprecated, use defineColorCMYK() instead.

May raise ValueError if an invalid color name is specified.

defineColorCMYK

defineColorCMYK("name", c, m, y, k)

Defines a new color "name". The color Value is defined via four components: c = Cyan, m = Magenta, y = Yellow and k = Black. Color components should be in the range from 0 to 255.

May raise ValueError if an invalid color name is specified.

defineColorCMYKFloat

defineColorCMYKFloat("name", c, m, y, k)

Defines a new color "name". The color Value is defined via four components: c = Cyan, m = Magenta, y = Yellow and k = Black. Color components are floating point values between 0 and 100.

May raise ValueError if an invalid color name is specified.

defineColorLab

defineColorLab("name", L, a, b)

Defines a new color "name" using CIELab values. The color value is defined via three components: L = luminosity, a = green/red, b = blue/yellow. Color components are floating point values with L between 0 and 100, a and b between -128 and 128.

May raise ValueError if an invalid color name is specified.

defineColorRGB

defineColorRGB("name", r, g, b)

Defines a new color "name". The color Value is defined via three components: r = red, g = green, b = blue. Color components should be in the range from 0 to 255.

May raise ValueError if an invalid color name is specified.

defineColorRGBFloat

defineColorRGBFloat("name", r, g, b)

Defines a new color "name". The color Value is defined via three components: r = red, g = green, b = blue. Color components are floating point values between 0 and 255.

May raise ValueError if an invalid color name is specified.

deleteColor

deleteColor("name", "replace")

Deletes the color "name". Every occurrence of that color is replaced by the color "replace". If not specified, "replace" defaults to the color "None" - transparent.

deleteColor works on the default document colors if there is no document open. In that case, "replace", if specified, has no effect.

May raise NotFoundError if a named color wasn't found. May raise ValueError if an invalid color name is specified.

getColor

getColor("name") -> tuple

Returns a tuple (C, M, Y, K) containing the four color components of the color "name" from the current document. If no document is open, returns the value of the named color from the default document colors.

May raise NotFoundError if the named color wasn't found. May raise ValueError if an invalid color name is specified.

getColorAsRGB

getColorAsRGB("name") -> tuple

Returns a tuple (R,G,B) containing the three color components of the color "name" from the current document, converted to the RGB color space. If no document is open, returns the value of the named color from the default document colors.

May raise NotFoundError if the named color wasn't found. May raise ValueError if an invalid color name is specified.

getColorAsRGBFloat

getColorAsRGBFloat("name") -> tuple

Returns a tuple (R,G,B) containing the three color components of the color "name" from the current document, converted to the RGB color space. Color components are floating point values between 0 and 255. If no document is open, returns the value of the named color from the default document colors.

May raise NotFoundError if the named color wasn't found. May raise ValueError if an invalid color name is specified.

getColorFloat

getColorFloat("name") -> tuple

Returns a tuple (C, M, Y, K) containing the four color components of the color "name" from the current document. Color components are floating point values between 0 and 100. If no document is open, returns the value of the named color from the default document colors.

May raise NotFoundError if the named color wasn't found. May raise ValueError if an invalid color name is specified.

getColorNames

getColorNames() -> list

Returns a list containing the names of all defined colors in the document. If no document is open, returns a list of the default document colors.

isSpotColor

isSpotColor("name") -> bool

Returns True if the color "name" is a spot color. See also setSpotColor()

May raise NotFoundError if a named color wasn't found. May raise ValueError if an invalid color name is specified.

replaceColor

replaceColor("name", "replace")

Every occurrence of the color "name" is replaced by the color "replace".

May raise NotFoundError if a named color wasn't found. May raise ValueError if an invalid color name is specified.

setSpotColor

setSpotColor("name", spot)

Set the color "name" as a spot color if spot parameter is True. See also isSpotColor()

May raise NotFoundError if a named color wasn't found. May raise ValueError if an invalid color name is specified.