Class: oColor

$. oColor

$.oColor Base Class

new $.oColor(oPaletteObject, attributeObject)

openHarmony/openHarmony_color.js, line 394
The base class for the $.oColor.
Name Type Description
oPaletteObject $.oPalette The palette to which the color belongs.
attributeObject int The index of the color in the palette.
Properties:
Name Type Description
palette $.oPalette The palette to which the color belongs.

Members

colorObjectBaseColor

The Harmony color object.

idstring

The id of the color.

indexint

The index of the color.

namestring

The name of the color.

selectedbool

Whether the color is selected.

typeint

The type of the color.
Takes a string or array of strings for gradients and filename for textures. Instead of passing rgba objects, it accepts "#rrggbbaa" hex strings for convenience.
set gradients, provide an object with keys from 0 to 1 for the position of each color.
(ex: {0: new $.oColorValue("000000ff"), 1:new $.oColorValue("ffffffff")}).

Methods

copyToPalette(oPaletteObject, index)

openHarmony/openHarmony_color.js, line 601
Copies the palette to another Palette Object (CFNote: perhaps have it push to paletteObject, instead of being done at the color level)
Name Type Description
oPaletteObject $.oPalette The paletteObject to move this color into.
index int Need clarification from mchap

hexToRgba(hexString)

openHarmony/openHarmony_color.js, line 648
Static helper function to convert from hex string in format #FFFFFFFF to {r:int, g:int, b:int, a:int}
Consider moving this to a helper function.
Name Type Description
hexString string RGB object

moveToPalette(oPaletteObject, index)

openHarmony/openHarmony_color.js, line 585
Moves the palette to another Palette Object (CFNote: perhaps have it push to paletteObject, instead of being done at the color level)
Name Type Description
oPaletteObject $.oPalette The paletteObject to move this color into.
index int Need clarification from mchap

remove()

openHarmony/openHarmony_color.js, line 617
Removes the color from the palette it belongs to.

rgbaToHex(rgbaObject)

openHarmony/openHarmony_color.js, line 630
Static helper function to convert from {r:int, g:int, b:int, a:int} to a hex string in format #FFFFFFFF
Consider moving this to a helper function.
Name Type Description
rgbaObject obj RGB object