Skip to content

Translate colours to hexadecimal representation - #62

Merged
teunbrand merged 3 commits into
posit-dev:mainfrom
teunbrand:css_colors
Jan 15, 2026
Merged

teunbrand merged 3 commits into
posit-dev:mainfrom
teunbrand:css_colors

Conversation

@teunbrand

@teunbrand teunbrand commented Jan 14, 2026 •

Copy link
Copy Markdown
Collaborator

This PR aims to fix #26.

We're using the 'csscolorparser' crate to handle the conversion to hexadecimal strings.
Not only does this give us all CSS's named colours ('BurlyWood', 'Plum', etc.), but also parameterised colours like 'rgb(0,255,0)' or 'hsl(22, 75%, 50%)'. The quotes around these parametrisations are needed at this point.

Currently this conversion is only applied when setting colours via SETTING color => foo, and not in other places, notably MAPPING foo AS color. Once we implement manual scales, we should apply this conversion on that scale palette too.

@teunbrand
teunbrand requested a review from thomasp85 January 14, 2026 14:14
@teunbrand
teunbrand marked this pull request as ready for review January 14, 2026 14:14

@thomasp85 thomasp85 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@teunbrand
teunbrand merged commit 877e3a4 into posit-dev:main Jan 15, 2026
3 checks passed
@teunbrand
teunbrand deleted the css_colors branch January 15, 2026 11:24
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.

Include CSS color names

2 participants