Colour scheme in an Applet

R

Roedy Green

This is a question for the compulsive.

How do you best handle a colour scheme for an Applet?

ways to consider include:

1. put constants in an interlace

2. put constants in a class

3. put constants in a nested static class

4. use an enum.

5. put them direct in an interface. The main problem here is IDEs
reordering will not keep them all together.

consider ease of defining standard colour schemes to be used in many
Applets.

Randomising effects.


--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
 
T

Thomas Hawtin

Roedy said:
How do you best handle a colour scheme for an Applet?
1. put constants in an interlace

I'd go for this. But use static imports if I wanted to use without the
qualifying name. Or possibly in a class and use methods instead of
constants.

Alternatively use constants as keys to a map.

Tom Hawtin
 
R

Raymond DeCampo

Roedy said:
This is a question for the compulsive.

How do you best handle a colour scheme for an Applet?

ways to consider include:

1. put constants in an interlace

2. put constants in a class

3. put constants in a nested static class

4. use an enum.

5. put them direct in an interface. The main problem here is IDEs
reordering will not keep them all together.

consider ease of defining standard colour schemes to be used in many
Applets.

Randomising effects.

Define them outside of code in a resource file. Then changing colors
won't require a re-compile.

Ray
 
R

Roedy Green

Define them outside of code in a resource file. Then changing colors
won't require a re-compile.

It is an added benefit you can let customers change the colour scheme
even if you don't give them the source code.

--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
 
T

Thomas Hawtin

Raymond said:
Define them outside of code in a resource file. Then changing colors
won't require a re-compile.

If it's only developers changing the colours, then that seems overkill.
Even a basic implementation would be more difficult. I like my colour
schemes to have some kind of relationship between the colours, rather
than an angry fruit salad effect. So for easy of use, I should be able
to have some kind of computation going on.

Tom Hawtin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top