able to accept number & export number #44

Closed
wants to merge 2 commits into
from

Projects

None yet

4 participants

@Cactusbone

Hello!
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
jQuery Foundation member

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)

@Cactusbone

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
jQuery Foundation member

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
jQuery Foundation member

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

@gnarf
jQuery Foundation member

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
jQuery Foundation member

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

@gnarf gnarf closed this Nov 14, 2012
@Cactusbone

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.

@gnarf
jQuery Foundation member

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