-
-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
Please complete the following information:
- Library Version:
1.1.2 - Affected Device(s): Tested on
Pixel 7&Emulator
Describe the Bug:
- I'm using a custom
ImageBitmapto render the wheel on the color picker - I'd like to update the wheel color every time a new color is selected on
HsvColorPicker HsvColorPickeris still re-using the initialImageBitmap
Note: BrightnessSlider.wheelImageBitmap doesn't seem to have the same issue. This can also be worked around by using HsvColorPicker.drawOnPosSelected, so mainly wanted to raise and verify if this is an issue that'd be worth fixing
val controller = rememberColorPickerController()
Column {
HsvColorPicker(
modifier = Modifier.height(280.dp),
controller = controller,
wheelImageBitmap = createWheelImageBitmap(
offset = controller.selectedPoint.value,
color = controller.selectedColor.value,
), // the image isn't being updated
)
}fun createWheelBitmap(
offset: Offset,
color: Color,
) = ImageBitmap(
width = 75,
height = 75,
config = ImageBitmapConfig.Argb8888,
).also {
with(Canvas(it)) {
drawCircle(
center = offset,
radius = 75 / 2f,
paint = Paint().apply {
style = PaintingStyle.Fill
color = color,
},
)
}
}Expected Behavior:
HsvColorPickerupdateswheelImageBitmapwhen color is changed
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels