Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add colorToRGBArray function #808

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open

Conversation

jamesscottbrown
Copy link
Collaborator

This adds the colorToRGBArray function. This is needed in most projects that use Deck.gl, since Deck.gl requires colors to specified as an array of R/G/B values, and this is not the format in which our color tokens are defined (or which is returend by our color scales).

@ChrisKnightLDN
Copy link
Contributor

We could update our build pipeline to supply tokens defined as rgb values (or oklch or ...) maybe this function is a practical solution for now though?

@jamesscottbrown
Copy link
Collaborator Author

We could update our build pipeline to supply tokens defined as rgb values (or oklch or ...) maybe this function is a practical solution for now though?

That would help when assigning something to be, for example, our primary categorical color. But it wouldn't help for when we're applying a continuous color scale, as things like the D3 color scales don't directly give colors in this format.

@jamesscottbrown jamesscottbrown changed the title add convertColorToHex function add colorToRGBArray function Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants