3

Is it possible to get the hex or rgb values of the color names for these colors?

http://artific.com/library/css-2-system-colors.html

Say for example that I set a div to use "windowFrame" as the background color. Could I use:

https://developer.mozilla.org/en/DOM/window.getComputedStyle somehow?

1

1 Answer 1

1

getComputedStyle seems to work.

Firebug Output (working on http://artific.com/library/css-2-system-colors.html) :

var t = document.getElementsByClassName("window")[0]; window.getComputedStyle(t).backgroundColor;
"rgb(255, 255, 255)"

>>> var t = document.getElementsByClassName("menu")[0]; window.getComputedStyle(t).backgroundColor;
"rgb(240, 240, 240)"

>>> var t = document.getElementsByClassName("info")[0]; window.getComputedStyle(t).backgroundColor;
"rgb(225, 225, 225)"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.