Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#3188 closed enhancement (fixed)

Add all 147 colors to dojo.Color.named

Reported by: bill Owned by: Eugene Lazutkin
Priority: high Milestone: 1.0
Component: lfx Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description

Like the comment next to dojo.Color.named says, "rest will be added later". Should be 147 colors in all.

Attachments (3)

colors.js (3.8 KB) - added by Eugene Lazutkin 13 years ago.
lists all 147 colors
colors3.js (2.9 KB) - added by Eugene Lazutkin 13 years ago.
lists all 147 colors using some simple compression
test.html (2.0 KB) - added by Eugene Lazutkin 13 years ago.
compares color tables produced by colors.js and colors3.js

Download all attachments as: .zip

Change History (16)

comment:1 Changed 13 years ago by Eugene Lazutkin

Owner: changed from elatzukin to Eugene Lazutkin

comment:2 Changed 13 years ago by Eugene Lazutkin

Type: defectenhancement

comment:3 Changed 13 years ago by Eugene Lazutkin

Probably it makes sense to add "grey" color to the mix as a courtesy for our users. See #3228.

comment:4 Changed 13 years ago by bill

I'd rather you didn't, because it makes two names for the same thing, leading to "gray" being spelled different ways in different parts of the code, and also making it harder to generate an inverse lookup table, mapping from hex value to name. Bug #3228 is just asking us to fix the spelling in our CSS files.

comment:5 Changed 13 years ago by Eugene Lazutkin

Status: newassigned

comment:6 Changed 13 years ago by Eugene Lazutkin

I did some research on this matter.

A file with all 147 colors is 3,916 bytes. I doubt that our syntax compressor can do anything about it. I tried several different compression schemes. While it is possible to compress the data, the decompressor takes space too. The best I could get was 2,927 bytes before syntax compression. I guess that the syntax compressor can get ~100 additional bytes. So we are talking about 1k savings.

I am attaching the original file I played with, the compressed file, and the test file. All 3 files are supposed to be put in dojox/compression/tests/.

Changed 13 years ago by Eugene Lazutkin

Attachment: colors.js added

lists all 147 colors

Changed 13 years ago by Eugene Lazutkin

Attachment: colors3.js added

lists all 147 colors using some simple compression

Changed 13 years ago by Eugene Lazutkin

Attachment: test.html added

compares color tables produced by colors.js and colors3.js

comment:7 Changed 13 years ago by bill

Hmm, I wouldn't worry about doing decompression in javascript. That's what gzip etc. is for. (Sure, some people won't setup their web servers to do compression, but I don't want to go so far as to penalize people that do.)

It is a clever trick though.

comment:8 Changed 13 years ago by Eugene Lazutkin

I worried more about IE6, which doesn't support gziped .js files. At least it doesn't support them reliably, rendering the whole thing unusable. With IE7 out for a year I don't know how important the IE6 support for our users.

comment:9 Changed 12 years ago by Eugene Lazutkin

Resolution: fixed
Status: assignedclosed

(In [9532]) After multiple consultations I am committing a table of all named CSS3 colors. It populates (replaces) dojo.Color.named table. Because it is out of the core we don't sweat too much about its size => it is not manually compressed. Fixes #3188.

comment:10 Changed 12 years ago by Eugene Lazutkin

Sorry, it should be: "it is out of the base".

comment:11 Changed 12 years ago by Adam Peller

Resolution: fixed

(In [9534]) Provide translations for dojo.colors. Use mixins to add CSS3 to existing colors in _base. Fixes #3188

comment:12 Changed 12 years ago by Adam Peller

(In [9535]) Add translation comments, fix a few spellings. Refs #3188.

comment:13 Changed 12 years ago by Adam Peller

(In [9536]) more spelling fixes. hope I got them all this time. Refs #3188

Note: See TracTickets for help on using tickets.