Open rlancer opened 8 years ago
This is an odd behavior, but it's due to the way I am treating the hue rotation. For instance, harmonies are working similar to the "mudcube" sphere here. Notice, that the edge of that sphere is black, and the middle is white. So the complementary color of black is still black, and white is still white.
I know this is not intuitive. I don't know a lot about color theory, so this issue is probably solved already (I just need to look it up- and potentially change my code). I might be able to add multiple "modes" of harmonization, so '#000000' returns '#ffffff' in one mode while it behaves like it does now in another.
I see that the Adobe Kuler color wheel/sphere does not have super high/low lightness values shown, so the outside is not black (hence their "complementary" feature works intuitively).
Anyways, if you have ideas on how to fix, let me know. I'll look into it when I get a bit of time...
It's fine if its not supposed to work with black.
But then maybe update the readme to use a different color in the example.
The way I calculate hue rotation currently is on this line: https://github.com/skratchdot/color-harmony/blob/fa7b923fa151775a14a1dd3f2a0367a378994013/lib/color-harmony.js#L56
onecolor normalizes all values between 0 and 1, so I am just doing some stuff to rotate, then normalize.
@rlancer - good point. I'll update the README. Didn't realize I was using black as an example there :)
Might be cool to actually show screenshots of what it calculates too