![]() |
Provides methods to access palette colour objects and their gradient positions.
A palette colour can behave as a solid colour, a linear gradial or a radial gradient. When a palette colour is a gradient, it provides colour values at relative positions in the gradient.
A Simple Example - Creating a new solid palette colour on the project, and interacting with it.
Public Member Functions | |
bool | contains (OMC::Colour colour) |
Identifies if the list contains the given colour. Item can be a 3 RGB or 4 RGBA array, a OMC::Color or a OMC::PaletteGradientPosition. More... | |
Array [OMC::PaletteGradientPosition] | list () |
Converts the dynamic list into a concrete list of palette gradient position objects. More... | |
OMC::PaletteGradientPosition | add (OMC::Colour colour, float percentage) |
Adds a colour to the gradient. The input can also be a OMC::Color or OMC::PaletteGradientPosition. More... | |
OMC::PaletteGradientPosition | interpolate (float percentage) |
Returns a gradient position at the interpolated position. More... | |
OMC::PaletteGradientPosition | pop (int index) |
Pops given index object from this Palette colours. More... | |
void | remove (OMC::PaletteGradientPosition gradientPosition) |
Remove a colour position from the gradient. Throws error if unsuccessful. More... | |
void | clear () |
Clear all colours from the object. Throws error if unsuccessful. More... | |
OMC::PaletteList * | palette_list () |
Gets the parent palette list, or throws error if currently parentless. More... | |
OMC::Palette * | palette () |
Gets the parent palette, or throws error if currently parentless. More... | |
Public Attributes | |
OMC::PaletteGradientPosition | operator[int index] |
Provides the PaletteGradientPosition object at the given index. Note: setting value-type properties on the returned object will not take effect on this container object, since they are a copy and not the original object. More... | |
float | r |
Get and set the red value of the colour 0-255. More... | |
float | g |
Get and set the green value of the colour 0-255. More... | |
float | b |
Get and set the blue value of the colour 0-255. More... | |
float | a |
Get and set the alpha value of the colour 0-255. More... | |
double | h |
Get and set the hue value of the colour 0-360. More... | |
double | l |
Get and set the lightness value of the colour 0-100. More... | |
double | s |
Get and set the saturation value of the colour 0-100. More... | |
QString | hex |
Get and set the hex value of the colour in form #AARRGGBB. More... | |
OMC::Colour | colour |
Get and set the colour object part of the gradient position. More... | |
QString | type |
Provides the type of PaletteGradientPosition, can be either Solid, Linear or Radial Gradient. More... | |
QString | name |
The color pot name. More... | |
QString | base_type |
The base type of colour, either 'Colour' or 'Texture'. More... | |
QString | id |
Unique ID of the color. More... | |
bool | valid |
Get the validity of the object at the moment. More... | |
OMC::PaletteGradientPosition OMC::PaletteColour::add | ( | OMC::Colour | colour, |
float | percentage | ||
) |
Adds a colour to the gradient. The input can also be a OMC::Color or OMC::PaletteGradientPosition.
Example:
void OMC::PaletteColour::clear | ( | ) |
Clear all colours from the object. Throws error if unsuccessful.
Example:
bool OMC::PaletteColour::contains | ( | OMC::Colour | colour | ) |
Identifies if the list contains the given colour. Item can be a 3 RGB or 4 RGBA array, a OMC::Color or a OMC::PaletteGradientPosition.
Example:
OMC::PaletteGradientPosition OMC::PaletteColour::interpolate | ( | float | percentage | ) |
Returns a gradient position at the interpolated position.
Examplified at PaletteColour class description.
Array [OMC::PaletteGradientPosition] OMC::PaletteColour::list | ( | ) |
Converts the dynamic list into a concrete list of palette gradient position objects.
Examplified at PaletteColour class description.
|
inherited |
Gets the parent palette, or throws error if currently parentless.
Examplified in palette_list().
|
inherited |
Gets the parent palette list, or throws error if currently parentless.
Example:
OMC::PaletteGradientPosition OMC::PaletteColour::pop | ( | int | index | ) |
Pops given index object from this Palette colours.
Example:
void OMC::PaletteColour::remove | ( | OMC::PaletteGradientPosition | gradientPosition | ) |
Remove a colour position from the gradient. Throws error if unsuccessful.
Example:
|
readwrite |
Get and set the alpha value of the colour 0-255.
|
readwrite |
Get and set the blue value of the colour 0-255.
|
readinherited |
The base type of colour, either 'Colour' or 'Texture'.
OMC::PaletteColour::colour |
Get and set the colour object part of the gradient position.
|
readwrite |
Get and set the green value of the colour 0-255.
|
readwrite |
Get and set the hue value of the colour 0-360.
|
readwrite |
Get and set the hex value of the colour in form #AARRGGBB.
|
readinherited |
Unique ID of the color.
|
readwrite |
Get and set the lightness value of the colour 0-100.
|
readwriteinherited |
The color pot name.
OMC::PaletteGradientPosition OMC::PaletteColour::operator[int index] |
Provides the PaletteGradientPosition object at the given index. Note: setting value-type properties on the returned object will not take effect on this container object, since they are a copy and not the original object.
Example:
|
readwrite |
Get and set the red value of the colour 0-255.
|
readwrite |
Get and set the saturation value of the colour 0-100.
|
readwrite |
Provides the type of PaletteGradientPosition, can be either Solid, Linear or Radial Gradient.
|
readinherited |
Get the validity of the object at the moment.