https://kotlinlang.org logo
#compose-android
Title
# compose-android
a

ascii

09/22/2023, 9:08 AM
Is there no compose-specific color harmonization utility? material-components has
MaterialColors.harmonize()
, but that lib is more for View-based UIs. I don't want to import it just for one small function.
There's also
com.android.systemui.monet.blend.Blend.harmonize()
, but that can't be used directly
k

Kirill Grouchnikov

09/22/2023, 6:43 PM
You can use
Color.toArgb()
before passing them to the
harmonize
function. Otherwise, there’s not much view-specific - or Compose-specific in the proposed utility - to warrant an almost identical library.
As to the one small function, it will in any case bring other parts of that library, from
Blend
to
Hct
to various utils.
j

jordond

10/02/2023, 7:16 PM
While not exactly what you want, I created [MaterialKolor](https://github.com/jordond/materialkolor). Which allows you to generate a M3 palette from a seed color.