Skip to content

blog : relative color syntax channel values #1307

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

Conversation

romainmenke
Copy link
Member

@romainmenke romainmenke commented Mar 1, 2024

While reviewing the MDN docs for relative color and reading threads like this one it stands out that it isn't intuitively clear to people what the actual values are behind the channel keywords.

Part of the issue is that the specification has gone through multiple iterations while implementers were shipping.

I think that a visualization of the channel values might help.

This shows:

  • the channel keywords that will be available
  • the channel values for the origin color (the input color)
  • the math expressions per channel (this is just the input params)
  • the output channel values of the final color
Screenshot 2024-03-01 at 20 35 18 Screenshot 2024-03-01 at 22 59 59

When you use a known color function with incorrect channel keywords you will get a red outline while still seeing the actual channel keywords that are available.

Screenshot 2024-03-01 at 23 08 48

I keep going back and forth on some style choices like text alignments, so the first screenshots show a slightly older version than what I finally picked

@romainmenke romainmenke marked this pull request as ready for review March 1, 2024 22:11
@romainmenke
Copy link
Member Author

🤔 Maybe the ranges (ref 0% and ref 100%) should also be indicated for each channel.
Then you know what the current value is and what the sensible range of mutation is.

@romainmenke
Copy link
Member Author

I've added indicators for the percentage ref ranges.

Screenshot 2024-03-02 at 12 04 23

Copy link
Member

@Antonio-Laguna Antonio-Laguna left a comment

Choose a reason for hiding this comment

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

This is looking great to me! Awesome tool definitely to have handy!

@romainmenke
Copy link
Member Author

Thank you for reviewing 🙇

@romainmenke romainmenke merged commit 209d405 into main Mar 4, 2024
@romainmenke romainmenke deleted the relative-color-syntax-channel-values--resourceful-grouse-b85a2ccb2f branch March 4, 2024 17:46
@argyleink
Copy link
Contributor

this rocks! ty for making it!

@romainmenke
Copy link
Member Author

Thank you Adam 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants