WICG / color-api

A proposal and draft spec for a Color object for the Web Platform, loosely influenced by the Color.js work. Heavily WIP, if you landed here randomly, please move along.
https://wicg.github.io/color-api/
Other
130 stars 3 forks source link

Remove .getAll() and .setAll() #14

Closed LeaVerou closed 2 years ago

LeaVerou commented 2 years ago

As discussed with @tabatkins, these are superfluous since Color#coords is mutable.

For the same color space, they can be directly replaced with reading/writing .coords.

For different color spaces, they are still easily achievable with .coords:

// Read:
color.to(space).coords

// Write
color.coords = new Color(space, [...]).to(color.colorSpace).coords