RationalWiki:Help/Color
From RationalWiki
Color (colour to our transatlantic cousins) on computer screens is made up of 3 "primary" colors: red, green and blue.
You will often see this referred to as "RGB", these colors are "additive": zero of all three gives black, while maximum of all three makes white.[1]
Contents |
[edit] Colors by number
Computers work with powers of two. The relevant vocabulary for describing colors uses "hexadecimal", which is base sixteen.[2]
- 0 (zero) to 15 (which is 16 or 24 higher), using one hex digit for each base color, for a total of 163, or 4,096 values.
- 0 (Zero) to 255 (which is 256 or 28 higher), using two hex digits for each color, yielding a total of 2563, or 16,777,216 values;
Each base color (red, green, and blue) can have a value in one of these ranges.
Hexadecimal color codes are preceded by "#".
Using the 0-15 method, a RGB color is represented as #000 for black, through #FFF for white.
In the 0-255 method, black is #000000 and white is #FFFFFF.
Note that equal amounts of red, green and blue produce various shades of gray. Pure reds are of the form #XX0000, greens are #00XX00, and pure blue shades are #0000XX. Any color combination can be created using any number from 00 to FF in each of the three positions.
[edit] Colors by name
There are also palettes of named colors.
| Color name | Hexadecimal | Color name | Hexadecimal | Color name | Hexadecimal | Color name | Hexadecimal | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Background | Background | Background | Background | ||||||||
| aqua | #00FFFF | Sample text on black | black | #000000 | Sample text | blue | #0000FF | Sample text | fuchsia | #FF00FF | Sample text |
| gray | #808080 | Sample text | green | #008000 | Sample text | lime | #00FF00 | Sample text on black | maroon | #800000 | Sample text |
| navy | #000080 | Sample text | olive | #808000 | Sample text | purple | #800080 | Sample text | red | #FF0000 | Sample text |
| silver | #C0C0C0 | Sample text on black | teal | #008080 | Sample text | white | #FFFFFF | Sample text on black | yellow | #FFFF00 | Sample text on black |
There is another palette of named colors which might or might not work with various web browsers. (These colors are now generally functional on all browsers; see here).
[edit] Text color coding
Text colors are commonly manipulated with the "font" tag:
- <font color="red">RED TEXT</font>
- RED TEXT
- <font color="#0F0">GREEN TEXT</font>
- GREEN TEXT
- <font color="#0000FF">BLUE TEXT</font>
- BLUE TEXT
Note, the above method is old HTML and, although it will work for as long as this wiki is alive(?) it has been replaced by new HTML:
<span style="color:hex triplet or colour name">text</span>
<span style="color:red">red writing</span>- red writing
<span style="color:#0F0">green writing</span>- green writing
<span style="color:#0000FF">blue writing</span>- blue writing
This has the advantage that other attributes can be included in the same "span" tag.[3]
[edit] Other use of colors
Colors can also be defined in other html tags, such as table tags. BGCOLOR="#abcxyz" will set the background color of a table, row, or cell when used inside the appropriate tag. Wiki table colors can also be defined using the "style" attribute.
[edit] Examples to copy
As with many tricks and tools on computers, copying something you like is often the quickest way to get there.
[edit] Notes
- ↑ In printing, four colours are used: cyan, magenta, yellow and black (alright black's not really a color but that's the way it goes) referred to as "CMYK"; these are "subtractive": zero of all four gives white while maximum of all four (or maximum of all 3 colors, or just maximum of black) gives black)
- ↑ Hexadecimal numbers are how geeks count up to 16 (0 -15 actually) without using more than one digit. Count in hexadecimal: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F.
- ↑ You might like to follow up by reading about Cascading Style Sheets in Wikipedia.
| Help pages for RationalWiki | ||
|---|---|---|
| - RationalWiki -- Blocking -- Comments -- Standards -- Jargon -- Main help page -- Templates -- Bored -- Listing your creations -- Image copyright -- Cover story -- Edit summary -- Summary abbreviations -- Editing etiquette -- Navigation -- Day counter -- Copying code -- Image -- Links -- Lists -- Lurking -- Common mistakes -- Namespaces -- Writing a new article -- Titling pages -- Permanent links -- Quotations -- Link colors -- Redirects -- References -- Why register -- Headers and sections -- TOC (table of contents) -- Tables -- Template list -- Toolbar -- Watchlist -- Wikipedia help files -- Wiki language -- Signatures -- Vandalism -- A Newcomers' Guide -- Whitewash (the project) -- Side by side comparison -- Sysop guide -- Userboxen - | ||

