Skip to content

Comments

Improve custom palettes generation#419

Merged
GyulyVGC merged 11 commits intomainfrom
fix-styles
Dec 27, 2023
Merged

Improve custom palettes generation#419
GyulyVGC merged 11 commits intomainfrom
fix-styles

Conversation

@GyulyVGC
Copy link
Owner

@GyulyVGC GyulyVGC commented Dec 26, 2023

This PR simplify the user's activity when defining custom color palettes from files.

Before this PR, a user had to specify the following parameters:

  • primary
  • secondary
  • outgoing
  • text_headers
  • text_body
  • starred
  • buttons
  • round_borders_alpha
  • round_containers_alpha
  • chart_badge_alpha
  • is_nightly

Now, users can simply define a palette specifying the following colors:

  • primary
  • secondary
  • outgoing
  • text_headers
  • text_body
  • starred

...and Sniffnet will automatically infer if the palette is dark or light, determining as a consequence the color of buttons and opacity values.

To achieve this, a struct PaletteExtension has been defined; it is computed only once per theme (thanks to the use of once_cell) starting from a defined Palette.
The struct PaletteExtension doesn't only include the parameters that were removed from the user definition of the color scheme, but also two more fields that host the fonts of body text and headers text.

Moreover, the style of the 8 additional themes has been updated to follow the same derivation rules of the styles defined via TOML.

@GyulyVGC GyulyVGC added the enhancement New feature, request, or improvement label Dec 26, 2023
@GyulyVGC GyulyVGC added this to the v1.3.0 milestone Dec 26, 2023
Copy link
Owner Author

@GyulyVGC GyulyVGC left a comment

Choose a reason for hiding this comment

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

🚢

@GyulyVGC GyulyVGC changed the title Fix styles (custom palettes generation) Improve custom palettes generation Dec 26, 2023
@GyulyVGC GyulyVGC merged commit 2e71deb into main Dec 27, 2023
@GyulyVGC GyulyVGC deleted the fix-styles branch December 27, 2023 10:42
@GyulyVGC GyulyVGC added the design Styling and appearance label Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

design Styling and appearance enhancement New feature, request, or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant