MCPcopy
hub / github.com/microsoft/SandDance / colorToString

Function colorToString

packages/vega-deck.gl/src/color.ts:47–53  ·  view source on GitHub ↗
(color: RGBAColor)

Source from the content-addressed store, hash-verified

45 * @param color A Deck.gl RGBAColor array - (The rgba color of each object, in r, g, b, [a]. Each component is in the 0-255 range.)
46 */
47export function colorToString(color: RGBAColor) {
48 const c = [...color];
49 if (c.length > 3) {
50 c[3] /= 255;
51 }
52 return `rgba(${c.join(',')})`;
53}
54
55export function desaturate(color: RGBAColor, value: number): RGBAColor {
56 const rgb = d3rgb(color[0], color[1], color[2], color[3] / 255);

Callers 1

presentMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected