OMC::PaletteBaseColour Class Referenceabstract

Detailed Description

Interface base class for textures and colors owned by palettes.

Object is used as a base class and specialized behaviour is available in subclasses.

See OMC::PaletteColour and OMC::PaletteTexture for more information.

Public Member Functions

OMC::PaletteListpalette_list ()
 Gets the parent palette list, or throws error if currently parentless. More...
 
OMC::Palettepalette ()
 Gets the parent palette, or throws error if currently parentless. More...
 

Public Attributes

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...
 

Member Function Documentation

◆ palette()

OMC::Palette* OMC::PaletteBaseColour::palette ( )

Gets the parent palette, or throws error if currently parentless.

Returns
The palette object.

Examplified in palette_list().

◆ palette_list()

OMC::PaletteList* OMC::PaletteBaseColour::palette_list ( )

Gets the parent palette list, or throws error if currently parentless.

Returns
The palette list object.

Example:

from ToonBoom import harmony
palette_list = harmony.session().project.palettes;
# Clear the palette list of palettes (Optional)
palette_list.clear()
# Create a new colour palette:
new_colour_palette = palette_list.create('Colour','Palette_Name')
# Create new colour inside palette:
new_colour = new_colour_palette.create_solid_colour('Colour_A',[255,0,0])
# Access palette colours:
print(new_colour.palette_list().id == palette_list.id ) # True
print(new_colour.palette().id == new_colour_palette.id ) # True

Member Data Documentation

◆ base_type

QString OMC::PaletteBaseColour::base_type
read

The base type of colour, either 'Colour' or 'Texture'.

◆ id

QString OMC::PaletteBaseColour::id
read

Unique ID of the color.

◆ name

QString OMC::PaletteBaseColour::name
readwrite

The color pot name.

◆ valid

bool OMC::PaletteBaseColour::valid
read

Get the validity of the object at the moment.

Inheritance diagram for OMC::PaletteBaseColour:
Collaboration diagram for OMC::PaletteBaseColour: