Fooidge/PleaseJS

Support for contrasting colors

etcook opened this issue · 6 comments

Would be great to get the option of spitting out a harmonious contrasting color based on a color input.

I'll look into it. Based on my understanding it's a matter of finding a slightly offset complement and then inverting the value. If you wanna take a crack at it be my guest.

Cool - I'll research how to invert the HSV output and get back to you. Shouldn't be difficult. Do you have a preferred naming convention for contrasting colors? I'll likely just use your existing complementary function and then invert the result. Thoughts?

You could do that, but I don't think a good contrast is an exact complement. For instance, orange and blue are famous contrasts. And you'd probably just take the distance of the value from 0 or 1 and make the contrast color have that distance from the opposing side.

Added contrast function

@Fooidge You got to it before I had a chance to. Thanks a million!

It's what I do ;)

Jordan Checkman

On Jul 16, 2014, at 1:07 PM, "E.T.Cook" notifications@github.com wrote:

@Fooidge You got to it before I had a chance to. Thanks a million!


Reply to this email directly or view it on GitHub.