Opened 10 years ago
Closed 10 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)
Change History (3)
Changed 10 years ago by
comment:1 Changed 10 years ago by
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 10 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
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.
patch for dojox/widget/ColorPicker.js