Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color out of range #5

Open
gazay opened this issue Aug 2, 2015 · 2 comments
Open

Color out of range #5

gazay opened this issue Aug 2, 2015 · 2 comments

Comments

@gazay
Copy link
Contributor

gazay commented Aug 2, 2015

Maybe we should do same thing as done here – display closest possible color in rgb? http://bl.ocks.org/mbostock/3e115519a1b495e0bd95

@devgru
Copy link
Owner

devgru commented Aug 2, 2015

Detecting out of range colors is mission critical feature for this plugin.

You can easily disable it, just remove this three lines:

if (!hclColor.displayable()) {
throw decl.error('HCL color out of range: "' + value + '"');
}

HCL (CIELCH) and LAB are used when you want to get predictable perception, not predictable domain. So with HCL/LAB you easily get out-of-domain colors. E.g. you cannot ask for 'dark chromatic green', hcl(145, 60, 10) or 'bright chromatic blue', hcl(250, 60, 80). They are out of domain because there's no such colors.

To get predictable domain (360°, 100, 100) of nice cylinder with unpredictable perception and awful ΔE distribution one can use HSL or HSV.

Compare HSL and LAB domains to get the idea: http://bl.ocks.org/devgru/4c6c73b278a0dba364f8

IMHO there's more sense in improving HCL picker (http://devgru.github.io/hcl-picker/) so it will help you choose proper HCL gradient.

Also, there are better tools for selecting specific HCL gradients. I'm looking forward to port it into this PostCSS plugin.
http://gka.github.io/palettes/#diverging|c0=darkred,deeppink,lightyellow|c1=lightyellow,lightgreen,teal|steps=13|bez0=1|bez1=1|coL0=1|coL1=1

@gazay
Copy link
Contributor Author

gazay commented Aug 3, 2015

Wow, thanks for detailed answer! Then maybe add an option that allow you to use this plugin in unsafe mode?

When I tried to understand HCL spec – I found your hcl-picker, but I didn't get how to use it =) There is only rgb values on the right and no values for hcl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants