-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Support for CSS named colors #30
base: master
Are you sure you want to change the base?
Conversation
Oh! It's also worth nothing that this was implemented against the new CSS palette in |
1cc8cd2
to
abe57c9
Compare
color.go
Outdated
@@ -91,6 +96,8 @@ func (p Profile) Color(s string) Color { | |||
var c Color | |||
if strings.HasPrefix(s, "#") { | |||
c = RGBColor(s) | |||
} else if _, ok := palette.CSS.Color(s); ok { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be the last resort and we should try and convert the string to an integer first and, if that succeeds, treat it as a regular ANSI color. Not that there's currently a clash, but if someone added "8" as a color name to that palette, it would override the ANSI color. We wouldn't want that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Updated.
Just out: gamut v0.2.0 😄 |
Alright, bumped to Gamut v0.2.0! |
This adds support for CSS named colors via Gamut, so you can do something like the following (per #29):