able to accept number & export number #44

wants to merge 2 commits into


None yet
4 participants

I've added possibility to import/export numbers, i needed it to work with a webGL application where colors are numbers (0xff0102 for example).


danheberden commented Sep 3, 2012

Is there a reason youre doing manual parsing instead of (theInt).toString(16) and just parsing the hex like parseInt("0xff1234", 16)? And couldn't the end user do this perhaps? (instead of mudding up the API)

converting the number to string before parsing it using jQuery.color.parse would require padding (to ensure 6 digits).

I like just giving the color in any format to the library and getting a jQuery color and then getting the format i need out of it.


gnarf commented Sep 4, 2012

I need to think on this one a bit... I have seen multiple number based encoding methods for colors, and would hate to implement one of them now and later find out I need to support more than one...


mikesherov commented Oct 23, 2012

@gnarf37, I'm fine with this. If there are other numerical color formats, I haven't seen it.


gnarf commented Oct 24, 2012

The fact that this format doesn't include alpha really bugs me... My research into webGL shows that it uses an array of floats for RGBA for most of its work, and that this wouldn't be useful.

Can you show me the place where you needed it?


gnarf commented Nov 14, 2012

Too much silence here - closing for now. Can you please help me understand why we want this?

gnarf closed this Nov 14, 2012

sorry i forgot to update. it looks like this is the color format used by three.js
i'm not sure there are other cases so maybe this should be handled in three.js instead.


gnarf commented Nov 16, 2012

yeah, i haven't seen this format for colors used anywhere else, and it doesn't include the alpha channel which scares me.

Sorry, but I don't think I'm gonna land it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment