Colorhelper: Difference between revisions

From WiiBrew
Jump to navigation Jump to search
Pinecone (talk | contribs)
Blooper4912 (talk | contribs)
m Table of Colours: convert to wikitable
Line 17: Line 17:
==Table of Colours==
==Table of Colours==


<table width="70%" border="2" cellspacing="0" cellpadding="5"  
{| class="wikitable"
summary="Table listing color names and hex codes">
|-
<tr>
!Colour Name
<th>Colour Name</th>
!HEX Code
<th>HEX Code</th>
!Colour
<th>Colour</th>
|-
</tr>
|black
<tr>
|#000000
<td>black</td>
|bgcolor="#000000"|&nbsp;
<td>#000000</td>
|-
<td bgcolor="#000000">&nbsp;</td>
|white  
</tr>
|#ffffff
<tr>
|bgcolor="#ffffff"|&nbsp;
<td>white</td>
|-
<td>#ffffff</td>
|red
<td bgcolor="#ffffff">&nbsp;</td>
|#ff0000
</tr>
|bgcolor="#ff0000"|&nbsp;
<tr>
|-
<td>red</td>
|blue
<td>#ff0000</td>
|#0000ff
<td bgcolor="#ff0000">&nbsp;</td>
|bgcolor="#0000ff"|&nbsp;
</tr>
|-
<tr>
|green  
<td>blue</td>
|#008000
<td>#0000ff</td>
|bgcolor="#008000"|&nbsp;
<td bgcolor="#0000ff">&nbsp;</td>
|-
</tr>
|yellow
<tr>
|#ffff00
<td>green </td>
|bgcolor="#ffff00"|&nbsp;
<td>#008000</td>
|-
<td bgcolor="#008000">&nbsp;</td>
|orange
</tr>
|#ffa500
<tr>
|bgcolor="#ffa500"|&nbsp;
<td>yellow</td>
|-
<td>#ffff00</td>
|violet
<td bgcolor="#ffff00">&nbsp;</td>
|#ee82ee
</tr>
|bgcolor="#ee82ee"|&nbsp;
<tr>
|-
<td>orange</td>
|purple
<td>#ffa500</td>
|#800080
<td bgcolor="#ffa500">&nbsp;</td>
|bgcolor="#800080"|&nbsp;
</tr>
|-
<tr>
|pink
<td>violet</td>
|#ffc0cb
<td>#ee82ee</td>
|bgcolor="#ffc0cb"|&nbsp;
<td bgcolor="ee82ee">&nbsp;</td>
|-
</tr>
|silver
<tr>
|#c0c0c0
<td>purple</td>
|bgcolor="#c0c0c0"|&nbsp;
<td>#800080</td>
|-
<td bgcolor="#800080">&nbsp;</td>
|gold
</tr>
|#ffd700
<tr>
|bgcolor="#ffd700"|&nbsp;
<td>pink</td>
|-
<td>#ffc0cb</td>
|gray/grey
<td bgcolor="#ffc0cb">&nbsp;</td>
|#808080
</tr>
|bgcolor="gray"|&nbsp;
<tr>
|-
<td>silver</td>
|aqua
<td>#c0c0c0</td>
|#00ffff
<td bgcolor="#c0c0c0">&nbsp;</td>
|bgcolor="#00ffff"|&nbsp;
</tr>
|-
<tr>
|skyblue
<td>gold</td>
|#87ceeb
<td>#ffd700</td>
|bgcolor="#87ceeb"|&nbsp;
<td bgcolor="#ffd700">&nbsp;</td>
|-
</tr>
|lightblue
<tr>
|#add8e6
<td>gray/grey</td>
|bgcolor="#add8e6"|&nbsp;
<td>#808080</td>
|-
<td bgcolor="gray">&nbsp;</td>
|fuchsia
</tr>
|#ff00ff
<tr>
|bgcolor="#ff00ff"|&nbsp;
<td>aqua</td>
|-
<td>#00ffff</td>
|khaki
<td bgcolor="#00ffff">&nbsp;</td>
|#f0e68c
</tr>
|bgcolor="#f0e68c"|&nbsp;
<tr>
|}
<td>skyblue</td>
<td>#87ceeb</td>
<td bgcolor="#87ceeb">&nbsp;</td>
</tr>
<tr>
<td>lightblue</td>
<td>#add8e6</td>
<td bgcolor="#add8e6">&nbsp;</td>
</tr>
<tr>
<td>fuchsia</td>
<td>#ff00ff</td>
<td bgcolor="#ff00ff">&nbsp;</td>
</tr>
<tr>
<td>khaki</td>
<td>#f0e68c</td>
<td bgcolor="#f0e68c">&nbsp;</td>
</tr>
</table>


==Note==
==Note==

Revision as of 04:34, 20 November 2008

ColorHelper is a .h header file for any C or C++ project (WiiBrew or otherwise) which allows easy reference to 19 different colours in your project, by Pinecone.

How to Use

Fortunately, it couldn't be simpler:

  • 1: Download color.h
  • 2: Put color.h in your source directory
  • 3: add the following line to the top of any .c/.cc/.cpp/.h file from which you may want to reference colours:
#import "color.h"
  • 4: refer to your colour of choice using the following construction:
COLOR_<colorname>

so, if you wanted a dashing Khaki colour to use in your project, you would refer to it as follows:

COLOR_khaki

(note that the colour name is ALWAYS lower case)

Table of Colours

Colour Name HEX Code Colour
black #000000  
white #ffffff  
red #ff0000  
blue #0000ff  
green #008000  
yellow #ffff00  
orange #ffa500  
violet #ee82ee  
purple #800080  
pink #ffc0cb  
silver #c0c0c0  
gold #ffd700  
gray/grey #808080  
aqua #00ffff  
skyblue #87ceeb  
lightblue #add8e6  
fuchsia #ff00ff  
khaki #f0e68c  

Note

This was very easy to make and really anyone with half a brain could have done it. I just found it really useful in my projects to have a colour referencer handy.

Please appreciate the spelling of the word COLOR: I am English so I would rather have it spelt like this: COLOUR. For the sake of convention (and in light of the fact that there are a good deal of Americans here), all colours are spelt using the American COLOR spelling. In all non-coding contexts, however, you will notice I spell it with the English spelling Colour.

N.B: My apologies if the graphics library you are using uses colours encoded differently. I must stress that this was written for my own use, and I will not be taking suggestions or requests, for doing so is sheer laziness. If you are able to use it, you are able to change it.

Download color.h