• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Color options for jLabels

 
Michael Giara
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Was wondering if there's a Dark Green

Don't think so without RGBing it, (Color.DARKGREEN) but wanted to ask.
 
Michael Giara
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually that's just about exactly the shade of green I'm looking for.  The one in the op.
Java's Color.GREEN is lime-ish and I personally find it harsh to look at
 
Brian Cole
Author
Ranch Hand
Posts: 912
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael Giara wrote:Was wondering if there's a Dark Green

Don't think so without RGBing it, (Color.DARKGREEN) but wanted to ask.


Color.GREEN.darker()
 
Michael Giara
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brian Cole wrote:
Michael Giara wrote:Was wondering if there's a Dark Green

Don't think so without RGBing it, (Color.DARKGREEN) but wanted to ask.


Color.GREEN.darker()

Thank you Brian!

Too funny how it's that easy haha
 
Piet Souris
Rancher
Posts: 1518
32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another way to look at this is:

Color(0,0,0) is black and so Color(0, 20, 0) is a little green, but is still pretty 'blackish'
 
Sergiu Dobozi
Ranch Hand
Posts: 66
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And if one wants an even darker shade of that color? Do you write something like Color.GREEN.darker().darker().darker().darker().darker().darker()? :-D
This is what I understand from https://docs.oracle.com/javase/7/docs/api/java/awt/Color.html
 
Michael Giara
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Very cool observations Piet and Sergio
Thanks for pointing them out!
 
Campbell Ritchie
Sheriff
Posts: 51346
86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another way to get a particular colour is with a colour chooser.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic