G4P select color question?

Is there any way to get the color chooser that comes up with G4P.selectColor() to come up with the with a certain color chosen? I've seen on the Java color chooser there is a method setColor() to do that. Is there any way to get to that method for the color chooser G4P.selectColor() is using?

Tagged:

Answers

  • Answer ✓

    I just checked and it is not possible to pre select the colour. After first use it will remember the last colour selected and will use this next time this method is called.

    Shame really because it would be really easy to implement, I just didn't get to do it :)

  • edited September 2015

    Thanks for the quick reply. I guess I'll have to it with java.swing. There's some good tutorials on it. In my case its important, because the paint color can be changed in other ways.

  • G4P uses Swing for the colour chooser, I will add the option to specify the start colour in the next version.

  • edited September 2015

    I think it would be a good add. Paint programs usually have some key shortcut to pick up a color off the screen. In that context, it would make sense for the current color to come up and not the last one specifically chosen with the color picker.

    sel_col = G4P.selectColor(currentColor) would be grand :)

  • Thats exactly the format I intend to use, but keep the original version as well so the yser takes their pick :)

Sign In or Register to comment.