ianstormtaylor / css-color-function

A parser and converter for Tab Atkins's proposed color function in CSS.
92 stars 13 forks source link

[FEATURE] parse hwb values #1

Closed kristoferjoseph closed 10 years ago

kristoferjoseph commented 10 years ago

I started to add the contrast adjuster as specified in the CSS Color Module 4 spec and realized that the parser doesn't accept hwb colors.

My reasoning for using hwb for this is it allows you to manipulate contrast while leaving the hue at the correct angle for later adjustments without requiring further conversions.

Can you give any guidance as to how you would want that added?

There is a conversion function specified in the spec here hwbToRgb that could be added to the parser if you want. Was thinking I could publish a module with just the hwb converters in it for anyone to use.

Thoughts?

ianstormtaylor commented 10 years ago

hey! that sounds awesome. i think the best way might be to get support for hwb included in color? since that's the lib i was using underneath. if not that, then ideally we could just parse from hwb at the start into something that color recognizes and then use it still, to keep a single code path

kristoferjoseph commented 10 years ago

Funny you should mention that. I have a branch in my fork of color that does just that. I'll make a PR and see if she can find it in her heart to merge it. If not can we talk more about adding it to the parser? Thanks! :love_letter:

MoOx commented 10 years ago

Will be handled by my incoming PR (ref)

kristoferjoseph commented 10 years ago

\0/