Welcome to Dream.In.Code
Become a Java Expert!

Join 150,423 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,097 people online right now. Registration is fast and FREE... Join Now!




hexidecimal color references

 
Reply to this topicStart new topic

hexidecimal color references

stew_downunder
2 Apr, 2008 - 11:30 PM
Post #1

New D.I.C Head
Group Icon

Joined: 4 Apr, 2007
Posts: 17


Dream Kudos: 75
My Contributions
Hey all,

Instead of the standard boring colors surely there must be a way to activate the hexidecimals

I have tried syntax like:

CODE
setBackground( Color.#ff00ff );


but no luck

so where standard colors would be activated such as:

CODE
setBackground( Color.gray );


what is the syntax to activate the hexidecimal colors??
User is offlineProfile CardPM
+Quote Post

KYA
RE: Hexidecimal Color References
2 Apr, 2008 - 11:54 PM
Post #2

#include <nerd.h>
Group Icon

Joined: 14 Sep, 2007
Posts: 5,954



Thanked: 160 times
Dream Kudos: 1375
My Contributions
You can define/experiment with various colors using a variety of numbers from 1-255

Read This and This


Did you search for this at all before posting? The java API is your friend smile.gif

This post has been edited by KYA: 2 Apr, 2008 - 11:55 PM
User is online!Profile CardPM
+Quote Post

pbl
RE: Hexidecimal Color References
3 Apr, 2008 - 03:46 AM
Post #3

D.I.C Lover
Group Icon

Joined: 6 Mar, 2008
Posts: 3,594



Thanked: 233 times
Dream Kudos: 75
My Contributions
QUOTE

I have tried syntax like:

CODE
setBackground( Color.#ff00ff );




The correct syntax is:

CODE
setBackground(new Color(0xff, 0, 0xff));

User is online!Profile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 08:36PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month