TinyColor
TinyColor copied to clipboard
Add "toInt" so stuff like PIXI.js can use the generated values
I looked at the doc and do not see a way to get the raw hex/int out of the tinycolor instance as needed in pixi.js.
toInt : function(allow3Char) {
return parseInt(rgbToHex(this._r, this._g, this._b, allow3Char),16);
},
Adding that will do just fine. Do not know if it is the most efficient way though.
Yes, please do add this. And thanks @EnderPicture - your function will do for me for now. I also work with pixi :). But yes, it seems kinda obvious to have an int output. Such a pity it got overlooked.