public void setColor(String color) { int[] rgb = ColorUtils.getRGB(color); int[] hsl = ColorUtils.rgb2hsl(rgb); hue = hsl[0]; handleX = (int) Math.min(Math.max(Math.round(hsl[1] * 180d / 100d), 0), 179); handleY = (int) Math.min(Math.max(Math.round(hsl[2] * 180d / 100d), 0), 179); drawGradient(true); fireColorChanged(color); } }
public void setColor(String color) { int[] rgb = ColorUtils.getRGB(color); int[] hsl = ColorUtils.rgb2hsl(rgb); hue = hsl[0]; handleX = (int) Math.min(Math.max(Math.round(hsl[1] * 180d / 100d), 0), 179); handleY = (int) Math.min(Math.max(Math.round(hsl[2] * 180d / 100d), 0), 179); drawGradient(true); fireColorChanged(color); } }
public void setHue(int hue) { this.hue = hue; drawGradient(false); String color = getColorAtPixel(handleX, handleY); drawGradient(true); fireColorChanged(color); }
public void setHue(int hue) { this.hue = hue; drawGradient(false); String color = getColorAtPixel(handleX, handleY); drawGradient(true); fireColorChanged(color); }