Is there a way to list out the internal browser colors, so: aliceblue, antiquewhite, aqua, aquamarine, azure, beige, bisque, etc.. I'd like to be able to pop open the dev tools on a browser and loop through them all. Anyone?
-
-
Replying to @spences10
Been wondering that myself too. Here's some info, but not what we're after.. Maybe ppl like
@una,@paul_irish or@mathias might know.. ?1 reply 0 retweets 1 like -
Replying to @tomhermans @spences10 and
The list is defined in the spec: https://drafts.csswg.org/css-color/#named-colors …
1 reply 0 retweets 2 likes -
Replying to @mathias @tomhermans and
Thank you Mathias, I was wondering if it was accessible programatically so I could forEach through them?
1 reply 0 retweets 0 likes -
Replying to @spences10
Scott, found this: https://github.com/ChromeDevTools/devtools-frontend/blob/master/front_end/common/Color.js#L757 … line 760: export const Nicknames = { 'aliceblue': [240, 248, 255], 'antiquewhite': [250, 235, 215], 'aqua': [0, 255, 255], 'aquamarine': [127, 255, 212], ..
1 reply 0 retweets 1 like
Or take it straight from the source by running this snippet in the @ChromeDevTools Console on the spec page I linked to:
[...document.querySelectorAll('.named-color-table [id^="valdef-color-"]')].map(element => element.textContent);
-
-
Brill! Thanks Mathias
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.