dheid / colorpicker

A nice color picker using Java Swing that contains a visual color selection and input boxes to enter RGB and HSB values manually.

Home Page:https://www.daniel-heid.de/open-source-projekte/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Illegal argument exception when color wheel is tiny

seedee opened this issue · comments

Describe the bug
When the component gets too small such as when the frame is resized, the color wheel disappears entirely. However, the selection handle/circle is still visible and creates an exception when you click on it.

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: The saturation value (-5.3851647) must be between [0,1]
	at com.bric.colorpicker.ColorPickerPanel.setHSB(ColorPickerPanel.java:460)
	at com.bric.colorpicker.ColorPickerPanel$ColorPickerMouseInputListener.mousePressed(ColorPickerPanel.java:682)

Thanks for opening the issue! I will look at it

I think I fixed this error. You'll find a new version 1.4.8 with the bugfix included.