Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to convert hexadecimal value in int value

 
Aayush Patel
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to make color through hexadecimal value....can anybody help me...means i want color through hexadecimal value which is passed in applet code.....
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Aayush,
Just use the Color( int rgb ) constructor.
0x 0000 0000 00RR GGBB
where R = red, G = green, and B = blue.
Examples:
Hex Number Decimal Value
0x0000000000FFFFFF 16777215
0x0000000000888888 8947848
0x0000000000000000 0
Regards,
Manfred.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!