pigment
0.7.0indexedColor selector component designed for seamless integration with Jetpack Compose, offering customizable flow and lazy row layouts for intuitive color selection in user interfaces.
22
Stars
—
Used by
dependents
—
Health
/ 100
Color selector component designed for seamless integration with Jetpack Compose, offering customizable flow and lazy row layouts for intuitive color selection in user interfaces.
🎨 A color selector for Compose Multiplatform.
dependencies {
implementation("dev.sergiobelda.pigment:pigment:$VERSION")
}
kotlin {
sourceSets {
commonMain.dependencies {
implementation("dev.sergiobelda.pigment:pigment:$VERSION")
}
}
}
val colorPickerItems = remember {
listOf(
ColorPickerItem(color = Color.Unspecified),
ColorPickerItem(color = Color.Black),
ColorPickerItem(color = Color(0x80FF4444)),
ColorPickerItem(color = Color(0xFFEF5350), enabled = false),
).toMutableStateList()
}
val (selectedColor, onColorSelected) = remember {
mutableStateOf(Color.Unspecified)
}
ColorPicker.FlowRow(
colors = colorPickerItems,
selectedColor = selectedColor,
onColorSelected = onColorSelected,
)
val colorPickerItems = remember {
listOf(
ColorPickerItem(color = Color.Unspecified),
ColorPickerItem(color = Color.Black),
ColorPickerItem(color = Color(0x80FF4444)),
ColorPickerItem(color = Color(0xFFEF5350), enabled = false),
).toMutableStateList()
}
val (selectedColor, onColorSelected) = remember {
mutableStateOf(Color.Unspecified)
}
ColorPicker.LazyRow(
colors = colorPickerItems,
selectedColor = selectedColor,
onColorSelected = onColorSelected,
)
Copyright 2024 Sergio Belda
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance the License.
You may obtain a copy of the License at
http:
Unless applicable law agreed to writing, software
distributed under the License distributed an BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express implied.
See the License the specific language governing permissions
limitations under the License.
Surfaced from shared tags and platforms — no rankings paid for.