The ColorManager JavaScript class. This interface is used to control the current palette active color.
More...
The ColorManager JavaScript class. This interface is used to control the current palette active color.
- Note
- Handle color
var id = cm.getColorIdFromPosition(6);
cm.setActiveColor(id);
◆ addCurrentColorToPalette
| void ColorManager::addCurrentColorToPalette |
( |
| ) |
|
|
slot |
Add a new color to the palette with the current RGBA value.
◆ exportColors
| void ColorManager::exportColors |
( |
String |
path | ) |
|
|
slot |
Export the color palette to a .plt file.
- Parameters
-
| path | - full path for the output file (Note: if the file already exists, it will be overwritten) |
◆ getColorDataWithId
| BaseColor ColorManager::getColorDataWithId |
( |
String |
id | ) |
|
|
slot |
Get the color data of a color from the palette.
- Parameters
-
| id | - id of the color in the palette |
- Returns
- BaseColor Color data
◆ getColorDataWithIndex
| BaseColor ColorManager::getColorDataWithIndex |
( |
int |
index | ) |
|
|
slot |
Get the color data of a color from the palette.
- Parameters
-
| index | - position of the color in the palette |
- Returns
- BaseColor Color data
var color = cm.getColorDataWithIndex(2);
◆ getColorIdFromPosition
| String ColorManager::getColorIdFromPosition |
( |
int |
index | ) |
|
|
slot |
Gets the Id of a color from the palette.
- Parameters
-
| index | - the position of the color in the palette |
- Returns
- Returns the color Id from the ColorView.
◆ getCurrentColorData
| ColorRGBA ColorManager::getCurrentColorData |
( |
| ) |
|
|
slot |
Get the color data of the currently active color.
- Returns
- BaseColor Color data
var color = cm.getCurrentColorData();
◆ getCurrentColorH
| int ColorManager::getCurrentColorH |
( |
| ) |
|
|
slot |
Gets the Hue of the currently active color.
- Returns
- the Hue (between 0 and 255)
◆ getCurrentColorOpacity
| int ColorManager::getCurrentColorOpacity |
( |
| ) |
|
|
slot |
Get the opacity of the currently active color.
- Returns
- The alpha (opacity) value between 0 and 255
◆ getCurrentColorS
| int ColorManager::getCurrentColorS |
( |
| ) |
|
|
slot |
Gets the Saturation of the currently active color.
- Returns
- the Saturation (between 0 and 100)
◆ getCurrentColorV
| int ColorManager::getCurrentColorV |
( |
| ) |
|
|
slot |
Gets the Value of the currently active color.
- Returns
- the Value (between 0 and 100)
◆ importColors
| void ColorManager::importColors |
( |
String |
path, |
|
|
bool |
importDuplicate |
|
) |
| |
|
slot |
Import colors from a .plt file.
- Parameters
-
| path | - path to the .plt file |
| importDuplicate | - whether or not duplicate colors will be imported |
◆ importTexture
| void ColorManager::importTexture |
( |
String |
path | ) |
|
|
slot |
Import a texture.
- Parameters
-
| path | - path to the texture file |
◆ removeCurrentColor
| void ColorManager::removeCurrentColor |
( |
| ) |
|
|
slot |
Remove the currently selected color from the palette.
◆ saveAsDefaultPalette
| void ColorManager::saveAsDefaultPalette |
( |
| ) |
|
|
slot |
◆ setActiveColor
| void ColorManager::setActiveColor |
( |
String |
id | ) |
|
|
slot |
Select a color from the palette to be the active one.
- Parameters
-
◆ setCurrentColorHSVA
| void ColorManager::setCurrentColorHSVA |
( |
int |
h, |
|
|
int |
s, |
|
|
int |
v, |
|
|
int |
a |
|
) |
| |
|
slot |
Set a HSV value to the currently active color.
- Parameters
-
| h | - Hue (between 0 and 255) |
| s | - Saturation (between 0 and 100) |
| v | - Value (between 0 and 100) |
| a | - Alpha (between 0 and 255) |
◆ setCurrentColorOpacity
| void ColorManager::setCurrentColorOpacity |
( |
int |
a | ) |
|
|
slot |
Set the opacity of the currently active color.
- Parameters
-
| a | - alpha (opacity) (between 0 and 255) |
◆ setCurrentColorRGBA
| void ColorManager::setCurrentColorRGBA |
( |
int |
r, |
|
|
int |
g, |
|
|
int |
b, |
|
|
int |
a |
|
) |
| |
|
slot |
Set a RGB value to the currently active color.
- Parameters
-
| r | - Red channel value (between 0 and 255) |
| g | - Green channel value (between 0 and 255) |
| b | - Blue channel value (between 0 and 255) |
| a | - Alpha value (between 0 and 255) |