Hi, I'm wondering if I could get some feedback on ...
# compose
z
Hi, I'm wondering if I could get some feedback on my color picker library before I make a proper announcement. I just wanna get some feedback on the API, maybe performance improvements or ideas/feature requests. Thanks https://github.com/zt64/compose-pipette
👍 1
r
You should document that this produces sRGB colors. It would also be nice if the picker worked in other color spaces. Note: I also wouldn't call it "pipette" as it's usually the tool used to sample from an image. Technically correct but might be confusing?
I also noticed you allocated during draw. For instance: drawCircle(Brush.radialGradient(listOf(Color.hsv(0f, 0f, color.hsvValue), Color.Transparent)))
Would be good if you only allocated when values change
In ColorSquare you reallocate an object that never changes
👀 1
(transparent to black gradient)
z
So that would just be putting wrapping the brushes with a remember block? And regarding the colorspaces, how could I do that? I figured as sRGB was the most common it wouldn't be worth the effort, assuming it would need a lot of changes to make it work
a
one thing that I find odd about the API is that it gives a onColorChanged callback instead of having a state of some sort. I've found it much simpler to be working with state objects than callbacks in compose
2
d
I used this HSV color picker in my app. It works well. https://github.com/skydoves/colorpicker-compose