avh4 / elm-color

Standard representation of colors, encouraging sharing between packages. (This replaces elm-lang/core#Color from Elm 0.18.)
BSD 3-Clause "New" or "Revised" License
23 stars 6 forks source link

Adds LAB and HCL color spaces #23

Open gampleman opened 4 years ago

gampleman commented 4 years ago

This PR adds the math to specify and output colors in the CIELAB and HCL color spaces.

These are especially useful for information visualization as they are perceptually uniform, but are also suitable for color manipulation and UI tasks, like generating palettes or themes.

There are some open API design questions/caveats:

I would be grateful for direction on the above points.

avh4 commented 4 years ago

Thanks for taking the time to put this together, and sorry for the slow reply.

My current goal for this package is to be a minimal API that allows other packages to have a common Color type that they can all use. With that goal in mind, I'm avoiding add all possible colorspace conversions and trying to keep this package as small as reasonably possible.

Would you be interested in making a separate package for these additional color space conversions? If you do publish one, I'd be happy to link to it in the README for this package.

In any case, I'll leave this PR open for further discussion and for reference.