disguise developers

Designer Plugins

Plugins for Disguise Designer software.

Colour

A floating-point RGBA representation of a Colour

This class does not hold any colour space information, therefore the precise meaning of the values will depend on the context in which it is used.

Base class: _BlipValue

Properties

a : float

The alpha (transparency) component of the colour.
Between 0-1, 0 is fully transparent, 1 is fully opaque.

UserName: A

b : float

The blue component of the colour.
Between 0-1 if an sRGB value, may be outside this range otherwise.

UserName: B

g : float

The green component of the colour.
Between 0-1 if an sRGB value, may be outside this range otherwise.

UserName: G

r : float

The red component of the colour.
Between 0-1 if an sRGB value, may be outside this range otherwise.

UserName: R

Variables

black : Colour

blackZeroAlpha : Colour

blue : Colour

caramel : Colour

cyan : Colour

darkGrey : Colour

fromHSL : Callable

green : Colour

grey : Colour

lightGrey : Colour

lime : Colour

magenta : Colour

orange : Colour

pink : Colour

red : Colour

transparent : Colour

turquoise : Colour

white : Colour

whiteZeroAlpha : Colour

yellow : Colour

Constructors

__init__(self)

__init__(self, other: Colour)

Copy constructor for Colour

__init__(self, rgb: Colour, a: float)

__init__(self, r: float, g: float, b: float)

__init__(self, r: float, g: float, b: float, a: float)

__init__(self, col: Col)

__init__(self, hdr: HDRColour)

Methods

mix(self, c: Colour, f: float) -> Colour

Mixes two colours together.

Performs a linear interpolation between this and another colour based on a mix factor f.

Parameters:

Returns A new colour that is a mix between this and the given colour.

toCol(self) -> Col

Converts the colour to an 8-bit Col structure.

Returns An 8-bit Col representation of this colour.

toHSL(self) -> Vec

Convert the colour to HSL (Hue, Saturation, Luminance) format.

Returns A vector containing the hue, saturation, and luminance values of the colour.

toNormalisedColour(self) -> Colour

Converts the colour to normalised float form.

Returns A new Colour object with RGBA components limited to the range 0-1.

toVec(self) -> Vec

Converts the colour object to a vector.

Returns A vector containing the RGB components of this colour.

Special Methods

__add__(self, c: Colour) -> Colour

Adds two colours

Performs a component-wise addition of the two colours, including alpha. Values above one are saturated at one.

Parameters:

Returns The resulting colour

__eq__(self, c: Colour) -> bool

Equality comparison operator for colours.

Parameters:

Returns True if all RGBA components of the colours are equal, false otherwise.

__mul__(col, x) -> Any

Multiply the elements of the colour by a value

Parameters:

Returns The colour with its elements multiplied by x

__ne__(self, c: Colour) -> bool

Checks if two colours are not equal.

Parameters:

Returns True if any of the RGBA components of the colours are not equal, false otherwise.

__repr__(self) -> Any

String representation of the colour

__rmul__(col, x) -> Any

Multiply the elements of the colour by a value

Parameters:

Returns The colour with its elements multiplied by x

__sub__(self, c: Colour) -> Colour

Subtracts another colour from this one.

Performs a component-wise subtraction of the given colour from this one. Values below zero are saturated at zero.

Parameters:

Returns The resulting colour.