Skip to content

Latest commit

 

History

History
78 lines (66 loc) · 2.86 KB

API.md

File metadata and controls

78 lines (66 loc) · 2.86 KB

ax5palette

Kind: global class
Author: [email protected]

ax5palette.setConfig(config) ⇒ ax5palette

Preferences of palette UI

Kind: static method of ax5palette

Param Type Default
config Object
config.target Element
[config.selectedColor] String
[config.colors] Object
[config.colors.preview] Object
[config.colors.preview.width] Number 24
[config.colors.preview.height] Number 24
[config.colors.preview.cellWidth] Number 30
[config.colors.label] Object
[config.colors.label.width] Number 80
[config.colors.slider] Object
[config.colors.slider.trackHeight] Number 8
[config.colors.slider.amount] Number 32
[config.colors.slider.handleWidth] Number 18
[config.colors.slider.handleHeight] Number 18
[config.colors.list] Array.<Object> [red,orange,yellow,green,blue,purple,black,white]
config.colors.list[].label String
config.colors.list[].value String
[config.controls] Object
[config.controls.height] Number 0

Example

myPalette = new ax5.ui.palette({
 target: $('[data-ax5palette="01"]'),
 onClick: function (hexColor) {
     alert(hexColor);
 }
});

myPalette = new ax5.ui.palette({
 target: $('[data-ax5palette="01"]'),
 colors: {
     list: [
         {label: "red", value: "#ff0000"},
         {label: "orange", value: "#ff9802"},
         {label: "yellow", value: "#ffff00"},
         {label: "skyblue", value: "#84e4ff"},
         {label: "white", value: "#ffffff"}
     ]
 }
 onClick: function (hexColor) {
 }
});

ax5palette.repaint() ⇒ ax5palette

Kind: static method of ax5palette

ax5palette.setSelectedColor(selectedColor) ⇒ ax5palette

Kind: static method of ax5palette

Param
selectedColor