We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Theme::from_source_color
#5 related
I was looking into the variations in theme outputs and this is what I've learned:
themeFromSourceColor
CorePalette.of(source)
CorePalette
theme_from_source_color
CorePalette::of(source).primary.tone(40)
In my testing, I have already written a lot of the code to do the second version. It would be a scheme based on MaterialLightColorSchemeFromPalette:
MaterialLightColorSchemeFromPalette
impl SchemeFromPalette { /// Generates a light colour scheme from a core palette. /// /// This has less fields than [`Scheme`]. pub fn light(argb: Argb) -> Self { let palette = CorePalette::of(argb); Self { primary: palette.primary.tone(40), on_primary: palette.primary.tone(100), primary_container: palette.primary.tone(90), on_primary_container: palette.primary.tone(10), secondary: palette.secondary.tone(40), on_secondary: palette.secondary.tone(100), secondary_container: palette.secondary.tone(90), on_secondary_container: palette.secondary.tone(10), tertiary: palette.tertiary.tone(40), on_tertiary: palette.tertiary.tone(100), tertiary_container: palette.tertiary.tone(90), on_tertiary_container: palette.tertiary.tone(10), error: palette.error.tone(40), on_error: palette.error.tone(100), error_container: palette.error.tone(90), on_error_container: palette.error.tone(10), background: palette.neutral.tone(99), on_background: palette.neutral.tone(10), surface: palette.neutral.tone(99), on_surface: palette.neutral.tone(10), surface_variant: palette.neutral_variant.tone(90), on_surface_variant: palette.neutral_variant.tone(30), outline: palette.neutral_variant.tone(50), outline_variant: palette.neutral_variant.tone(80), shadow: palette.neutral.tone(0), scrim: palette.neutral.tone(0), inverse_surface: palette.neutral.tone(20), inverse_on_surface: palette.neutral.tone(95), inverse_primary: palette.primary.tone(80), } }
The text was updated successfully, but these errors were encountered:
closed in 0.3.0
Sorry, something went wrong.
No branches or pull requests
Issue
#5 related
I was looking into the variations in theme outputs and this is what I've learned:
Theme::from_source_color
is similar to Material Theme Builder's, but not identical. Mismatched colors comparing to Material Theme Builder #5 (comment)themeFromSourceColor
is based onCorePalette.of(source)
.CorePalette
is correct, matching C++ and JS implementations.themeFromSourceColor
is not the same as Material Theme Builder or this crate's.Proposed
theme_from_source_color
.theme_from_source_color
that behaves like the JS implementation (where primary isCorePalette::of(source).primary.tone(40)
.In my testing, I have already written a lot of the code to do the second version. It would be a scheme based on
MaterialLightColorSchemeFromPalette
:The text was updated successfully, but these errors were encountered: