philholden / color-array

Functional color conversion between CSS strings and rgba arrays
1 stars 0 forks source link

Package refactoring #1

Open dy opened 5 years ago

dy commented 5 years ago

Hello Phil!

In some of my work projects there is a necessity to create a package, converting any list of input colors to normalized output array, eg.

toArray(['rgba(0,0,0,255)', [0,0,0,1], new Uint8Array[255,255,255,255], 'white', 0xff00ff ...], 'uint8')
// creates flat uint8 array with sequence of colors

The color-rgba / color-normalize, similar to the color-array, convert any input color to normalized uint8/dtype array well, but very often it is required to normalize a sequence of colors, something closer pxls. Many components do that routine: gl-waveform, regl-line2d, regl-scatter2d and others. I was thinking that would be a good idea to split that task into a separate package.

Just wonder - would you mind giving up an npm name to implement new functionality? I'd place color-array to @colorjs org. Do you depend on color-array in any projects?

dy commented 5 years ago

@philholden any thoughts?