I've added possibility to import/export numbers, i needed it to work with a webGL application where colors are numbers (0xff0102 for example).
now able to accept number & export number
style updated & added tests
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.
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...
@gnarf37, I'm fine with this. If there are other numerical color formats, I haven't seen it.
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?
Too much silence here - closing for now. Can you please help me understand why we want this?
sorry i forgot to update. it looks like this is the color format used by three.js http://mrdoob.github.com/three.js/docs/52/#Reference/Core/Color
i'm not sure there are other cases so maybe this should be handled in three.js instead.
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.