I have an image in the imageview. What I want to do is add color to it. Basically it's like a layer of color on the image. So I am trying to add color to a t-shirt image using the ColorPicker and I don't know how I can do that. I've tried it along with the colorAdjust class but its giving me a different color on the tshirt than the one I've chosen from the ColorPicker.
I am using SceneBuilder, btw.
GUI
T-shirt
@FXML
private void changecolor(ActionEvent event) {
Color mycolor=mycolorpicker.getValue();
label.setBackground(new Background(new BackgroundFill(mycolor,null,null)));
Image img=new Image(getClass().getResourceAsStream("tshirt7.PNG"));
imageV.setImage(img);
ColorAdjust colorAdjust = new ColorAdjust();
colorAdjust.setHue((mycolor.getHue()/360));
colorAdjust.setSaturation(mycolor.getSaturation());
colorAdjust.setBrightness(mycolor.getBrightness()-1);
imageV.setEffect(colorAdjust);
}
I was expecting the same color on the image as the one I've chosen from ColorPicker. But the color on the tshirt is not accurate.