question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

selectByHsvColor() not working

See original GitHub issue
  • Library Version [e.g. v2.2.3] (tried multiple versions)
  • SDK 30

Describe the Bug:

When I try to selectByHsvColor() I get an error saying:

selectByHsvColor(@ColorInt int color) can be called only when the palette is an instance of ColorHsvPalette. Use setHsvPaletteDrawable();

But when I try to setHsvPaletteDrawable() I get an error:

 java.lang.IllegalArgumentException: width and height must be > 0
        at android.graphics.Bitmap.createBitmap(Bitmap.java:1113)
        at android.graphics.Bitmap.createBitmap(Bitmap.java:1080)
        at android.graphics.Bitmap.createBitmap(Bitmap.java:1030)
        at android.graphics.Bitmap.createBitmap(Bitmap.java:991)
        at com.skydoves.colorpickerview.ColorPickerView.setHsvPaletteDrawable(ColorPickerView.java:741)

I don’t use a custom Palette Drawable.

I have my ColorPicker in my main activity like this:

<com.skydoves.colorpickerview.ColorPickerView
        android:layout_width="300px"
        android:layout_height="300px"
        android:id="@+id/colorPickerView"
        >
</com.skydoves.colorpickerview.ColorPickerView>

Expected Behavior:

selectByHsv() should work since I don’t use custom Palette Drawable.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ComradeVanticommented, Nov 8, 2021

@skydoves, thanks that worked. Might want to integrate that into the setHsvPaletteDrawable call itself and release a new version with that.

1reaction
skydovescommented, Nov 8, 2021

Hey @KingVanti, Could you build with like this?

post {
 this.setHsvPaletteDrawable()
 this.selectByHsvColor(hsv.asColorInt())
}

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Choosing the correct upper and lower HSV boundaries for ...
To find a color, usually just look up for the range of H and S , and set v in range(20, 255). To...
Read more >
Color Filtering/Segmentation/Detection – HSV - Computer Vision
Now using inRange() function, we will filter all the colors that are in between the range of lower and upper boundaries. For example...
Read more >
5.3. Color Picker - GIMP Documentation
The Color Picker Tool is used to select a color on any image opened on your screen. By clicking a point on an...
Read more >
Color Picker — Blender Manual
The color picker is a pop-up that lets you define a color value. Holding Ctrl while dragging snaps the hue to make it...
Read more >
Color - Scripting API - Unity - Manual
This structure is used throughout Unity to pass colors around. Each color component is a floating point ... HSVToRGB, Creates an RGB colour...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found