new $.oPalette(paletteObject, paletteListObject)
openHarmony/openHarmony_palette.js, line 65
$.oPalette constructor.
Name | Type | Description |
---|---|---|
paletteObject |
palette | The Harmony palette object. |
paletteListObject |
paletteList | The Harmony paletteListObject object. |
Properties:
Name | Type | Description |
---|---|---|
paletteObject |
palette | The Harmony palette object. |
scene |
oSceneObject | The DOM Scene object. |
Members
-
colorsArray.<oColor>
-
The oColor objects contained in the palette.
-
currentColoroColor
-
The color currently active in the palette view. 'null' if no color is currently selected
-
readonlyelement$.oElement
-
The element containing the palette if stored in element folder.
-
idstring
-
The palette ID.
-
indexint
-
The palette index in the palette list.
-
namestring
-
The palette name.
-
paletteStorage$.oFile
-
The storage place for the palette (environment, scene, job, element or external)
-
readonlypath$.oFile
-
The palette path on disk.
-
selectedbool
-
Whether the palette is selected.
Methods
-
addColor(name, colorValue)
openHarmony/openHarmony_palette.js, line 274 -
Adds a solid color to the palette
Name Type Description name
string the display name for the newly created color colorValue
$.oColorValue a $.oColorValue object describing the color -
addGradient(name, colorValues, radial)
openHarmony/openHarmony_palette.js, line 301 -
Adds a gradient to the palette, using the passed values
Name Type Description name
string colorValues
object an object with keys between 0 and 1 containing a colorValue for each "tack". ex: {0: new $.oColorValue("000000ff"), 1:new $.oColorValue("ffffffff")} radial
bool -
addTexture(name, texturePath, tiled)
openHarmony/openHarmony_palette.js, line 287 -
Adds a texture swatch to the palette
Name Type Description name
string texturePath
string tiled
bool Wether the texture will be tiled or not -
getColorById(id)
openHarmony/openHarmony_palette.js, line 324 -
Gets a oColor object based on id. 'null' if the color is not found in this palette
Name Type Description id
string the color id as found in toonboom palette file. -
getColorByName(name)
openHarmony/openHarmony_palette.js, line 339 -
Gets a oColor object based on name. Warning: more than one color can have the same name in a palette, the first one found will be returned.
Name Type Description name
string the color name for the color in the palette. -
remove(removeFile)
openHarmony/openHarmony_palette.js, line 354 -
Removes the palette file from the filesystem and palette list.
Name Type Description removeFile
bool Whether the palette file should be removed on the filesystem.