TinyColor icon indicating copy to clipboard operation
TinyColor copied to clipboard

Add "toInt" so stuff like PIXI.js can use the generated values

Open EnderPicture opened this issue 7 years ago • 1 comments

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.

EnderPicture avatar Aug 25 '17 07:08 EnderPicture

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.

jared83 avatar Apr 25 '18 08:04 jared83