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

Control component tint automatic calculatioins in cosmic theme #637

Open
maria-komarova opened this issue Oct 10, 2024 · 0 comments
Open
Milestone

Comments

@maria-komarova
Copy link

maria-komarova commented Oct 10, 2024

The color is defined in the Design system as @small_widget_container. It depends on the background of the surface where the widget is placed. Widgets that use this color include standard buttons, text inputs, segmented controls. The steps are:

  1. Take the color of the surface where the widget is placed and check lightness value.
  2. Use lightness of the surface color and add or subtract 5 steps in lightness. To find out whether to add or subtract - check the lightness of @bg_color:
  • If lightness is 65 or lighter, use darker colors for smaller widgets.
  • If lightness is 64.9 to 51.1, use lighter colors.
  • If lightness is 51.1 to 40.1, use darker colors.
  • If lightness is 40 and darker, use lighter colors.
  1. Take the color input (what we call neutral tint right now or pure black for default modes), use the calculated lightness value from the previous steps.
  2. Adjust the chroma value to 0.03 if the color input has a higher value.
  3. Use the resulting color as the widget background.

The text in the widget should use the text color variable of the respective surface the widget is placed on. Same with divider colors.

@WatchMkr WatchMkr added this to the alpha 3 milestone Oct 10, 2024
@WatchMkr WatchMkr moved this to Alpha 3 in COSMIC Epoch 1 Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Alpha 3
Development

No branches or pull requests

2 participants