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 Theming and Theme Customization #42

Merged
merged 23 commits into from
Aug 20, 2024
Merged

Add Theming and Theme Customization #42

merged 23 commits into from
Aug 20, 2024

Conversation

conways-glider
Copy link
Owner

@conways-glider conways-glider commented Aug 1, 2024

Description

Adds theming and much more customization to identicon-rs.

  • Adds 2 types of theme enum variants.
    • Selection, to cover a set of predefined colors
    • Range, to encapsulate a legacy design

This is done via the new Theme trait. This allows for end users to build their own theme types or to customize the Selection and Range themes.

Tasks

  • Update library to accept theme as a parameter
  • Update library to have default theme
  • Add Selection Theme enum variant
  • Add Range Theme enum variant
  • Move HSL/Color logic into Selection Variant
  • Expand tests
  • Ensure tests run for all features
  • Add bounds checking around Range values (or change trait functions to return Result<RGB, Error>)
  • Ensure new theme types are customizable (via constructors)
  • Add examples
  • Fill out more palette options

This will break the consistency test and is therefore a breaking change.

Closes #36

conways-glider and others added 10 commits August 1, 2024 01:26
The fact that the consistency test had to change means that we will have
to consider this feature a breaking change and thus a major version
bump.
* Use a trait instead of an enum

* Update documentation

* Run cargo fmt

* Clean up test

* Rename `Themey` to `Theme`

* Add identicon methods around theme
@conways-glider conways-glider changed the title Add Theming Add Theming and Theme Customization Aug 6, 2024
@conways-glider conways-glider marked this pull request as ready for review August 20, 2024 02:49
@conways-glider conways-glider merged commit 47cc003 into main Aug 20, 2024
6 checks passed
@conways-glider conways-glider deleted the theming branch August 20, 2024 02: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.

Add theming and different color palettes
1 participant