Opened 8 years ago

Closed 8 years ago

#12125 closed enhancement (invalid)

ColorPicker preview fix

Reported by: dreddy Owned by: dante
Priority: high Milestone: tbd
Component: DojoX Widgets Version: 1.5
Keywords: Cc:
Blocked By: Blocking:

Description

the colorPicker got two little square to preview colors : one to preview the selected color and one, i suppose, to view the old one

But the old one preview change with the color selection.

here's a proposed fix

Attachments (1)

patch (114 bytes) - added by dreddy 8 years ago.
patch for dojox/widget/ColorPicker.js

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by dreddy

Attachment: patch added

patch for dojox/widget/ColorPicker.js

comment:1 Changed 8 years ago by dreddy

line 490 : if (this.webSafe) {

this.safePreviewNode.style.backgroundColor = webSafeFromHex(hex);

}

by

if (this.webSafe && this.safePreviewNode.style.backgroundColor == "") {

this.safePreviewNode.style.backgroundColor = webSafeFromHex(hex);

}

comment:2 Changed 8 years ago by dante

Resolution: invalid
Status: newclosed

That second preview box is for "websafe" colors, which is a subset of the full color spectrum available in the picker. On line 15 in ColorPicker?.js you can see why the second box displays the same value as the websafe box. If you'd like to write a function to strip the color down to its nearest websafe hex value, please do so.

http://en.wikipedia.org/wiki/Web_colors explains about 256-color limitations, and was the intent of that box.

If you don't want to see the box, set websafe to false.

Note: See TracTickets for help on using tickets.