color-js / color.js

Color conversion & manipulation library by the editors of the CSS Color specifications
https://colorjs.io
MIT License
1.81k stars 80 forks source link

[`getAll`] Add an option(?) so that formatted coords can be returned #542

Closed DmitrySharabin closed 3 weeks ago

DmitrySharabin commented 4 weeks ago

This idea initially came from the need to show coords in a color swatch formatted as they are in the parsed color. Something like this:

image

@LeaVerou pointed out that, unfortunately, there is no way to do it now, but it might be a good feature of getAll().

So, I'm filing this issue to request this feature. 🙃

LeaVerou commented 4 weeks ago

Low hanging fruit would be to add precision, we could also add type which would serialize to <angle> or <percentage>.