jordond / MaterialKolor

🎨 A Compose multiplatform library for generating dynamic Material3 color schemes from a seed color
https://materialkolor.com
MIT License
506 stars 10 forks source link

Blend is internal. Harmonize, a necessary function for custom colors, is unavailable as a result #90

Closed nxoim closed 9 months ago

nxoim commented 9 months ago

the usefulness of harmonization is showcased at https://m3.material.io/styles/color/advanced/adjust-existing-colors#1cc12e43-237b-45b9-8fe0-9a3549c1f61e. a harmonized tonal palette could hypothetically look like


val desiredColor = if (harmonize) harmonize(MaterialTheme.colorScheme.primary.toArgb(), someColor) else someColor

val palette = TonalPalette.fromInt(desiredColor)
nxoim commented 9 months ago

i forgot one thing. a tool to adjust a color's saturation to match another color's saturation is also kinda needed. a palette made from a saturated color will look off when used on a dull theme

nxoim commented 9 months ago

Update: i have made a draft implementation and a couple examples for it. https://github.com/jordond/MaterialKolor/commit/29dfe9485b76f4051a3578e053e4b585a878f400

jordond commented 9 months ago

I've whipped up a PR with the blend functionality, and with your second suggestion.

jordond commented 9 months ago

It's available now in 1.4.0-alpha05