nanobot Posted September 19, 2016 Share Posted September 19, 2016 I really like the idea of hwb! I can't get it to work! This works... var str = "hsl(" + i + " , 50%, 50%)" ; ctx1.strokeStyle = str; This does not work. I get a this is not a function error from Google. var str = "hwb(" + i + " , 100%, 0%)" ; or //ctx1.strokeStyle = "rgb("+ hwbToRgb( i , 0, 0).r + " , " + hwbToRgb( i , 0, 0).g + ", " + hwbToRgb( i , 0, 0).b + ")"; See small attached code for working program of rotating cube. newminimumCp.html Link to comment Share on other sites More sharing options...
Ingolme Posted September 19, 2016 Share Posted September 19, 2016 The file you attached does work. The hwbToRgb() function only exists if you load the w3color.js file, it's not native to the browser. I don't think any browsers natively support hwb() as a color format. Link to comment Share on other sites More sharing options...
nanobot Posted September 20, 2016 Author Share Posted September 20, 2016 Thank you! This I know to be true. But the Documentation says if I include the w3color.js file, which I did, it should work. Not even var str = "hwb(" + i + " , 50%, 50%)" ; works. I like the hwb concept - It's not a "Must" because the other way works. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now