Usha Kommuri
Usha Kommuri

Reputation: 71

How to get ColorPalette in color picker component

Am working on Flash CS 6. Am using color picker component but when ever i click on color picker it is displaying just some list of colors.But i need rainbow color palette and its functionality.Is it possible to do ? If is there any way tel me.

Upvotes: 0

Views: 733

Answers (1)

gabriel
gabriel

Reputation: 2359

You can use the getter/setter colors (Array) of the class ColorPicker Gets or sets the array of custom colors that the ColorPicker component provides.

You can also customize your ColorPicker using setStyle

 import fl.controls.ColorPicker;

 const RAINBOW_COLORS:Array = [0x6c2a7d, 0x9ed8f5, 0x0093d0, 0xfee96c, 0xef4135];

 var colorPicker:ColorPicker = new ColorPicker();
 colorPicker.colors = RAINBOW_COLORS;
 colorPicker.selectedColor = RAINBOW_COLORS[0];

 colorPicker.setStyle('columnCount', 7); 
 colorPicker.setStyle('swatchWidth', 12); 
 colorPicker.setStyle('swatchHeight', 12); 
 colorPicker.setStyle('swatchPadding', 2); 
 colorPicker.setStyle('backgroundPadding', 2); 
 colorPicker.setStyle('textPadding', 7);

 addChild(colorPicker);

enter image description here

Upvotes: 1

Related Questions