2

I am trying to color some areas of my swing UI, but feel limited by the use of the

.setBackground(Color.//color here

Is there any way I can use the hex values of more specific and unique colors (there isn't even a brown) in this? whenever I try I am shown an error.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
William Brun
  • 353
  • 2
  • 17
  • 1
    You can use RGBA values to create your own colors and/or take a look at [these](http://stackoverflow.com/questions/4129666/how-to-convert-hex-to-rgb) examples of converting hex to RGB – MadProgrammer Sep 22 '13 at 21:44

1 Answers1

3

try

new Color(int r, int g, int b) 

for RGB

new Color(int r, int g, int b, int a) 

for ARGB (a=alpha transparence)