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 support for RGB hex colours #3

Merged
merged 5 commits into from
Sep 17, 2024
Merged

add support for RGB hex colours #3

merged 5 commits into from
Sep 17, 2024

Conversation

hugowetterberg
Copy link
Contributor

No description provided.

Copy link

@dannelundqvist dannelundqvist left a comment

Choose a reason for hiding this comment

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

I think it would be a good idea to support color the two definitions rgb and rgba (e.g. rgb(127, 127, 127,) and rgba(127, 127, 127, 0.5)) to accomodate for different design systems. More and more they are used over hex codes.

@hugowetterberg
Copy link
Contributor Author

Fair, but I'll limit it to the rgba(255,255,255,1.0) notation, apparently it's possible to use rgba(100%,100%,100%,1.0) .

@hugowetterberg
Copy link
Contributor Author

During the morning walk I realised that I don't like having the different colour types being top level formats (and mutually exclusive). I'll take another stab at this.

@hugowetterberg
Copy link
Contributor Author

There's now a colourFormats directive that makes it possible to specify the accepted formats. This makes it possible to accept multiple formats, and it will also be easier to add new colours (like hsl()) in the future.

@hugowetterberg hugowetterberg merged commit c0474c7 into main Sep 17, 2024
2 checks passed
@hugowetterberg hugowetterberg deleted the feature/colour branch September 17, 2024 09:50
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