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

Option to stay true to source color #15

Open
JimVanEeden opened this issue Jul 24, 2024 · 4 comments · May be fixed by #17
Open

Option to stay true to source color #15

JimVanEeden opened this issue Jul 24, 2024 · 4 comments · May be fixed by #17
Labels
enhancement New feature or request

Comments

@JimVanEeden
Copy link

Is there a plan to support the following option as can be seen at https://material-foundation.github.io/material-theme-builder/?

image

For my app it would be great to supply a theme color and have that being used as primary color as well. Apparently the color library does support that as it's an option in the theme builder. For now I'm overriding the primary color manually, but as can be seen, some other colors change as well when you enable the option.

Support for this option would be very much appreciated! Thanks

@pchmn
Copy link
Owner

pchmn commented Jul 26, 2024

Yes it seems to be called "color fidelity" (https://m3.material.io/styles/color/advanced/adjust-existing-colors#cb49eeb4-3bbd-4521-9612-0856c27f91ef), and @material/material-color-utilities supports it in last versions apparently.

I'll look into it !

@pchmn pchmn added the enhancement New feature or request label Jul 26, 2024
@pchmn pchmn linked a pull request Nov 22, 2024 that will close this issue
@pchmn
Copy link
Owner

pchmn commented Nov 22, 2024

Sorry for the delay, but you can try beta version @pchmn/[email protected] with color fidelity option:

const { theme, updateTheme } = useMaterial3Theme({ sourceColor: '#3E8260', colorFidelity: true });
// ...
updateTheme('#3E8260', { colorFidelity: true });

Tell me if it works for you, and I'll published it under stable version !

@pchmn
Copy link
Owner

pchmn commented Dec 6, 2024

@JimVanEeden did you have time to test it ?

@JimVanEeden
Copy link
Author

Thanks a lot for the effort! I'm excited to try it out, however I don't think I'll be touching the app for a couple of weeks, so I will post the update later. Of course if anybody else tries it out in the meantime, please let us know :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants