Monet
A Jetpack Compose library that creates your own Material3 palettes
Usages
// Choose a key color
val color = Color.Blue
// Generate tonal palettes with Vibrant style
val palettes = color.toHct().generateTonalPalettes(style = PaletteStyle.Vibrant)
// In your Theme.kt
CompositionLocalProvider(LocalTonalPalettes provides palettes) {
// Map TonalPalettes to Compose Material3 ColorScheme
val colorScheme = dynamicColorScheme()
MaterialTheme(colorScheme = colorScheme) {
// Primary color, use as normal
MaterialTheme.colorScheme.primary
}
}
Get more customizable:
// Don't limit to the default M3 palettes, use color mappings in your own way
40.a1 withNight 80.a1
Low-level APIs:
val rgb = Srgb(0.5, 0.5, 0.5)
rgb.toCam16()
// ...
Supported styles
- Tonal spot (default)
- Spritz (muted)
- Vibrant
- Expressive
- Rainbow
- Fruit salad
- Content
Import library (Gradle)
repositories {
maven("https://jitpack.io")
}
dependencies {
implementation("com.github.Kyant0:Monet:<TAG>")
}