initialize: function(options)
{
+ if (options.color) {
+ options.color = Color.normalizehex(options.color);
+ }
+
this.options = Object.extend({
- color: 'ffffff',
+ color: '#ffffff',
update: [],
draggable: false,
resizable: false,
*/
var Color = {
+ normalizehex: function(h)
+ {
+ if (h.substring(0, 1) == '#') {
+ h = h.substring(1);
+ }
+
+ if (h.length == 3) {
+ h = h.charAt(0).times(2) +
+ h.charAt(1).times(2) +
+ h.charAt(2).times(2);
+ }
+
+ return '#' + h;
+ },
+
hsv2hex: function(h)
{
return Color.rgb2hex(Color.hsv2rgb(h));