What colors can KineticJS use?

There seems to be no documentation that Color is in KineticJS (let me know if I'm wrong)

I still found through the trial version and an error that I can actually go to the following function: setFill from the Shape class:

 someShape.setFill("red"); someShape.setFill("#FF0000"); someShape.setFill("rgb(255,0,0)"); 

However, you cannot pass:

 someShape.setFill(0xff0000); someShape.setFill("rgb(100%,0%,0%)"); someShape.setFill("hsl(360,100,100)"); someShape.setFill("hsv(360,100,100)"); 

Again, this is a trial version and an error. Is there any final list?

+4
source share
1 answer

KineticJS passes the fill property to the fillStyle property of the canvas context, which parses the string into CSS color according to the CSS color model:

http://dev.w3.org/csswg/css3-color/

I tried each of the fill types you mentioned, and they actually all worked for me, except hsv, in Google Chrome. If they do not all work, because the browser you are using has not fully implemented color parsing in accordance with the W3C specification

+6
source

All Articles