godaddy / compose-color-picker

Jetpack Compose Android Color Picker 🎨
MIT License
369 stars 23 forks source link

support multi-platform #4

Closed HuixingWong closed 2 years ago

HuixingWong commented 2 years ago

Hello, i like your library and want using this on a multi-platform project so i make a small change for support it

riggaroo commented 2 years ago

Hi @HuixingWong, thanks so much for picking this up! Indeed its a request that #2 also is asking for :)

I've run it locally, but I think there is something wrong with the Canvas drawing logic on Desktop, it looks like it maybe doesn't support BlendMode.Multiply on Line 71 of SaturationValueArea, since the black underlying color doesn't come through correctly.

On startup on a phone: Screenshot_1636267337

On startup on Desktop:

Screenshot 2021-11-07 at 08 42 26

It also seems to be drawing a weird color when you play around with the Hue Bar which I haven't seen on the Android version (looks pretty but its not correct 😄 )

Screenshot 2021-11-07 at 08 43 27
riggaroo commented 2 years ago

I was actually curious about the Blend Mode issue, and have now discovered it does the same thing on API levels lower than 29 😭 I see you changed it to Modulate, I wonder if that works on lower Android API levels. Let me investigate a bit more and see!

riggaroo commented 2 years ago

Nice, modulate seems to fix that issue 🎉 I'll give it another look through and test everything again, but this is looking really good, thanks so much!