Skip to content

Set a custom named color #332

Discussion options

You must be logged in to vote

I imagine you are working within sRGB, so I'd create a custom sRGB color space class. Probably good to use the CSS variant so you can fall back to all the CSS serialization.

Check out this working example here. Just press edit to see/copy all the code.

You can omit the to_string serialization override if you have no need to serialize to those custom names.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@michaelfromyeg
Comment options

Answer selected by facelessuser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants