#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)
Change History (16)
comment:1 Changed 14 years ago by
Owner: | changed from elatzukin to Eugene Lazutkin |
---|
comment:2 Changed 14 years ago by
Type: | defect → enhancement |
---|
comment:3 Changed 14 years ago by
comment:4 Changed 14 years ago by
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 14 years ago by
Status: | new → assigned |
---|
comment:6 Changed 14 years ago by
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 14 years ago by
Attachment: | colors3.js added |
---|
lists all 147 colors using some simple compression
Changed 14 years ago by
compares color tables produced by colors.js and colors3.js
comment:7 Changed 14 years ago by
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 14 years ago by
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 14 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:11 Changed 14 years ago by
Resolution: | → fixed |
---|
Probably it makes sense to add "grey" color to the mix as a courtesy for our users. See #3228.