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

Remove hardcoded colors to allow Custom/flavor/hc background colors #845

Open
jpnurmi opened this issue Mar 8, 2023 · 3 comments
Open
Assignees
Labels
enhancement New feature or request theme

Comments

@jpnurmi
Copy link
Member

jpnurmi commented Mar 8, 2023

I experimented with giving yaruUbuntuBudgieLight and yaruUbuntuBudgieDark the correct background colors; #f5f6f7 and #20222a, respectively. It works pretty well besides a few hardcoded fill colors here and there. 🎉 I don't know if this is a planned/supported use case but would be cool to support!

image image image
image image image

/cc @fossfreedom

@jpnurmi
Copy link
Member Author

jpnurmi commented Mar 8, 2023

I didn't analyze what each value represents but some of these hardcoded color values could be problematic for those trying to customize the theme. Ideally, they would be either passed to createYaruLight/DarkTheme() or somehow calculated from the color scheme but I understand well that it might not always be possible or reasonable. :)

$ git grep --extended-regexp "\bColor(\.from\w+)?\("
lib/src/themes/common_themes.dart:const kDividerColorDark = Color.fromARGB(255, 65, 65, 65);
lib/src/themes/common_themes.dart:const kDividerColorLight = Color(0xffdcdcdc);
lib/src/themes/common_themes.dart:      light ? const Color(0xFFededed) : const Color.fromARGB(255, 40, 40, 40);
lib/src/themes/common_themes.dart:      ? const Color.fromARGB(255, 237, 237, 237)
lib/src/themes/common_themes.dart:      : const Color.fromARGB(255, 67, 67, 67);
lib/src/themes/common_themes.dart:    tertiary: const Color(0xFF18b6ec),
lib/src/themes/common_themes.dart:    tertiaryContainer: const Color(0xFF18b6ec),
lib/src/themes/common_themes.dart:    outline: const Color.fromARGB(255, 221, 221, 221),
lib/src/themes/common_themes.dart:    tertiary: const Color(0xFF18b6ec),
lib/src/themes/common_themes.dart:    tertiaryContainer: const Color(0xFF18b6ec),
lib/src/themes/common_themes.dart:    outline: const Color.fromARGB(255, 68, 68, 68),
lib/src/themes/common_themes.dart:      ? const Color.fromARGB(255, 34, 34, 34)
lib/src/themes/common_themes.dart:      ? const Color.fromARGB(255, 34, 34, 34)

@Feichtmeier
Copy link
Member

yes, all colors then need to descend from the colorscheme inserted into the functions
most of those colors are just shades of grey so this won't be much of a problem. if you want to work on this just make sure that the resulting color you pick from colorscheme matches the old colors (by 95% or so, doesn't need to be 100% I guess)

jpnurmi referenced this issue in jpnurmi/yaru.dart Mar 11, 2023
This makes it possible configure the background color of menus. I
sincerely hope surfaceVariant is a safe choice for this.

Ref: #302
@jpnurmi jpnurmi changed the title Custom/flavor background colors Custom/flavor/hc background colors Mar 13, 2023
@Feichtmeier Feichtmeier transferred this issue from ubuntu/archive_yaru.dart Feb 25, 2024
@Feichtmeier Feichtmeier changed the title Custom/flavor/hc background colors Remove hardcoded colors to allow Custom/flavor/hc background colors Mar 3, 2024
@Feichtmeier Feichtmeier self-assigned this Mar 3, 2024
@Feichtmeier Feichtmeier added theme enhancement New feature or request labels Mar 3, 2024
@Feichtmeier
Copy link
Member

Investigated a bit:

  • scaling colors to background/surface colors is easy (thanks to @Jupi007 's nice scal() function)
  • the problems are the YaruColor colors, we would need to parameterize the whole palette with arguments in createYaruLight/dark functions
  • this is out of scope/too risky for 4.0.0, I would re-investigate after that

Feichtmeier added a commit that referenced this issue Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request theme
Projects
None yet
Development

No branches or pull requests

2 participants