# Color code

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Color_code
> Markdown URL: https://mediated.wiki/source/Color_code.md
> Source: https://en.wikipedia.org/wiki/Color_code
> Source revision: 1322883186
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

System for displaying information by using different colors

For the computer science and graph theory method, see [Color-coding](/source/Color-coding). For other uses, see [Color code (disambiguation)](/source/Color_code_(disambiguation)).

This article may contain excessive or irrelevant examples. Please help improve it by removing less pertinent examples and elaborating on existing ones. (August 2023) (Learn how and when to remove this message)

[25-pair color code](/source/25-pair_color_code) chart used in certain kinds of wiring

A **color code** is a system for encoding and representing non-color information with [colors](/source/Color) to facilitate communication. This information tends to be [categorical](/source/Categorical_variable) (representing unordered/qualitative categories) though may also be sequential (representing an ordered/quantitative variable).

## History

The earliest examples of color codes in use are for long-distance communication by use of flags, as in [semaphore](/source/Flag_semaphore) communication.[1] The [United Kingdom](/source/United_Kingdom) adopted a color code scheme for such communication wherein [red](/source/Red) signified [danger](/source/Risk) and [white](/source/White) signified [safety](/source/Safety), with other colors having similar assignments of meaning.

As chemistry and other technologies advanced, it became expedient to use coloration as a signal for telling apart things that would otherwise be confusingly similar, such as [wiring](/source/Electrical_wiring) in electrical and electronic devices, and pharmaceutical [pills](/source/Pill_(pharmacy)).

## Encoded Variable

A color code encodes a variable, which may have different representations, where the color code type should match the variable type:

- [Categorical variable](/source/Categorical_variable) – the variable may represent discrete values of unordered qualitative data (e.g. blood type) - [Binary variables](/source/Binary_data#Binary_variable) are typically treated as a categorical variable (e.g. [sex](/source/Gendered_associations_of_pink_and_blue))

- [Quantitative variable](/source/Quantitative_variable) – the variable represents ordered, quantitative data (e.g. age) - Discrete quantitative data (e.g. the 6 sides of a [die](/source/Dice): 1,2,3,4,5,6) are sometimes treated as a categorical variable, despite the ordered nature.

## Types

See also: [Color scheme § In maps and data visualization](/source/Color_scheme#In_maps_and_data_visualization)

The types of color code are:

- **Categorical** – the colors are unordered, but are chosen to maximize saliency of the colors, by maximizing [color difference](/source/Color_difference) between all color pair permutations.

- **Continuous** – the colors are ordered and form a smooth color gradient.

- **Discrete** – only a subset of a continuous color code are used (still ordered), where each is distinguishable from the others.

### Categorical

When color is the only varied attribute, the color code is *unidimensional*. When other attributes are varied (e.g. shape, size), the code is *multidimensional*, where the dimensions can be *independent* (each encoding separate variables) or *redundant* (encoding the same variable). Partial redundancy sees one variable as a subset of another.[2] For example, [playing card suits](/source/Playing_card_suit) are multidimensional with color (black, red) and shape (club, diamond, heart, spade), which are partially redundant since clubs and spades are always black and diamonds and hearts are always red. Tasks using categorical color codes can be classified as identification tasks, where a single stimulus is shown and must be identified ([connotatively or denotatively](/source/Color_task)), versus search tasks, where a color stimulus must be found within a field of heterogenous stimuli.[3][2] Performance in these tasks is measured by speed and/or accuracy.[2]

The ideal color scheme for a categorical color code depends on whether speed or accuracy is more important.[3] Despite humans being able to distinguish 150 distinct colors along the hue dimension during comparative task, evidence supports that color schemes where colors differ only by hue (equal [luminosity](/source/Luminosity) and [colorfulness](/source/Colorfulness)) should have a maximum of [eight](/source/Eight) categories with optimized stimulus spacing along the hue dimension,[3] though this would not be color blind accessible. The [IALA](/source/IALA) recommends categorical color codes in seven colors: red, orange, yellow, green, blue, white and black.[4] Adding redundant coding of luminosity and colorfulness adds information and increases speed and accuracy of color decoding tasks.[3] Color codes are superior to others (encoding to letters, shape, size, etc.) in certain types of tasks. Adding color as a redundant attribute to a numeral or letter encoding in search tasks decreased time by 50–75%,[2]: Fig9 but in unidimensional identification tasks, using alphanumeric or line inclination codes caused less errors than color codes.[3][2]: 19

Several studies demonstrate a subjective preference for color codes over achromatic codes (e.g. shapes), even in studies where color coding did not increase performance over achromatic coding.[2]: 18 Subjects reported the tasks as less monotonous and less inducing of eye strain and fatigue.[2]: 18

The ability to discriminate color differences decreases rapidly as the [visual angle](/source/Visual_angle) subtends less than 12' (0.2° or ~2 mm at a viewing distance of 50 cm),[5] so color stimulus of at least 3 mm in diameter or thickness is recommended when the color is on paper or on a screen.[6] Under normal conditions, colored backgrounds do not affect the interpretation of color codes, but chromatic (and/or low) illumination of surface color code can degrade performance.[3]

## Criticism

Color codes present some potential problems. On forms and signage, the use of color can distract from black and white text.[7]

Color codes are often designed without consideration for accessibility to [color blind](/source/Color_blindness) and blind people, and may even be inaccessible for those with normal color vision, since use of many colors to code many variables can lead to use of confusingly similar colors.[7][8] Only 15–40% of the colorblind can correctly name surface color codes with 8–10 color categories, most of which test as mildly colorblind. This finding uses ideal illumination; when dimmer illumination is used, performance drops sharply.[8]

## Examples

Systems incorporating color-coding include:

- In electricity: - [25-pair color code](/source/25-pair_color_code) – telecommunications wiring - [ANSI Z535.1](/source/ANSI_Z535#Sub-Standards) Color Safety Code Standards - [Audio and video interfaces and connectors § Color codes](/source/Audio_and_video_interfaces_and_connectors#Color_codes) - [Optical fibers § Color codes](/source/Fiber-optic_cable#Color_coding) - [Electrical wiring](/source/Electrical_wiring) – AC power phase, neutral, and grounding wires - [Electronic color code](/source/Electronic_color_code) AKA resistor or EIA color code (today – IEC 60062:2016) - [Ethernet twisted-pair wiring](/source/Ethernet_physical_layer#Twisted-pair_cable) – local area networks - [Jumper cables](/source/Jump_start_(vehicle)) used to jump-start a vehicle - [PC99 connectors and ports](/source/PC_System_Design_Guide#Color-coding_scheme_for_connectors_and_ports) - [Surround sound ports and cables](/source/Surround_sound#Channel_identification) - [Three-phase electric power § Color codes](/source/Three-phase_electric_power#Color_codes) (electrical wiring)

- In video games - [Health](/source/Health_(gaming)) and [magic points](/source/Magic_(gaming)) - To distinguish friend from foe, for instance in *[StarCraft](/source/StarCraft)*, *[Halo](/source/Halo%3A_Combat_Evolved)*, or *[League of Legends](/source/League_of_Legends)* - To distinguish rarity or quality of items in adventure and [role-playing games](/source/Role-playing_game)[9]

- In navigation: - [Characteristic light](/source/Characteristic_light) - [Navigation light](/source/Navigation_light) - [Sea mark](/source/Sea_mark) - [Traffic lights](/source/Traffic_light)

- Other technology: - At point of sale (especially for [packaging](/source/Packaging) within a huge range of [products](/source/Stock_keeping_unit): to quickly differentiate variants, brands, categories) - ANSI Standardized Safety Colors [ANSI Z535](/source/ANSI_Z535) - [Bottled gases](/source/Bottled_gas) - [Fire extinguishers](/source/Fire_extinguisher) - [Kerbside collection](/source/Kerbside_collection) - [Pipe marking](/source/Pipe_marking) - [Queen bee birth year code](/source/Queen_bee#Identification) - [Underground utility location](/source/Utility_color_code) - [Hospital emergency codes](/source/Hospital_emergency_codes) often incorporate colors (such as the widely used "Code Blue" indicating a [cardiac arrest](/source/Cardiac_arrest)),

- In military use: - [Homeland Security Advisory System](/source/Homeland_Security_Advisory_System) - [Artillery shells](/source/Artillery_shell) and other munitions, which are color-coded according to their pyrotechnic contents - [List of Rainbow Codes](/source/List_of_Rainbow_Codes) - [NATO Military Symbols for Land Based Systems](/source/NATO_Military_Symbols_for_Land_Based_Systems#Affiliation) - [Rainbow Herbicides](/source/Rainbow_Herbicides)

- In social functions: - [Black hat hacking](/source/Black_hat_hacking), [white hat](/source/White_hat_(computer_security)), [grey hat](/source/Grey_hat) - [Blue-collar worker](/source/Blue-collar_worker), [white-collar worker](/source/White-collar_worker), [pink-collar worker](/source/Pink-collar_worker), [grey-collar](/source/Grey-collar), [green-collar worker](/source/Green-collar_worker) - [Handkerchief code](/source/Handkerchief_code) - [ISO 22324](/source/ISO_22324), Guidelines for color-coded alerts in public warning - [Cooper's Color Code](/source/Jeff_Cooper#Combat_mindset_and_the_Cooper_color_code) of the combat mindset - [Rank in judo](/source/Rank_in_judo) - [Ribbon](/source/Ribbon) colors *see:* [Category:Ribbon symbolism](https://en.wikipedia.org/wiki/Category:Ribbon_symbolism)

- In religion: - [Clerical vestments, frontals and altar hangings in Christian churches](/source/Liturgical_colours)

## See also

- [Color coding in data visualization](/source/Color_coding_in_data_visualization)

- [Secondary notation](/source/Secondary_notation)

## References

1. **[^](#cite_ref-1)** *Transactions of the American Society of Civil Engineers: Volume 29* (1893), p. 507.

1. ^ [***a***](#cite_ref-CHRIST75_2-0) [***b***](#cite_ref-CHRIST75_2-1) [***c***](#cite_ref-CHRIST75_2-2) [***d***](#cite_ref-CHRIST75_2-3) [***e***](#cite_ref-CHRIST75_2-4) [***f***](#cite_ref-CHRIST75_2-5) [***g***](#cite_ref-CHRIST75_2-6) Christ, Richard E. (December 1975). "Review and Analysis of Color Coding Research for Visual Displays". *Human Factors: The Journal of the Human Factors and Ergonomics Society*. **17** (6): 542–570. [doi](/source/Doi_(identifier)):[10.1177/001872087501700602](https://doi.org/10.1177%2F001872087501700602).

1. ^ [***a***](#cite_ref-JONES62_3-0) [***b***](#cite_ref-JONES62_3-1) [***c***](#cite_ref-JONES62_3-2) [***d***](#cite_ref-JONES62_3-3) [***e***](#cite_ref-JONES62_3-4) [***f***](#cite_ref-JONES62_3-5) Jones, Mari Riess (December 1962). "Color Coding". *Human Factors: The Journal of the Human Factors and Ergonomics Society*. **4** (6): 355–365. [doi](/source/Doi_(identifier)):[10.1177/001872086200400604](https://doi.org/10.1177%2F001872086200400604). [PMID](/source/PMID_(identifier)) [13964770](https://pubmed.ncbi.nlm.nih.gov/13964770).

1. **[^](#cite_ref-4)** IALA (December 2009). *The Surface Colours used as Visual Signals on Aids to Navigation* (2 ed.). International Association of Marine Aids to Navigation and Lighthouse Authorities. pp. 7–9.

1. **[^](#cite_ref-5)** Bedford, R. E.; Wyszecki, G. W. (1 February 1958). "Wavelength Discrimination for Point Sources". *Journal of the Optical Society of America*. **48** (2): 129–135. [Bibcode](/source/Bibcode_(identifier)):[1958JOSA...48..129B](https://ui.adsabs.harvard.edu/abs/1958JOSA...48..129B). [doi](/source/Doi_(identifier)):[10.1364/JOSA.48.000129](https://doi.org/10.1364%2FJOSA.48.000129). [PMID](/source/PMID_(identifier)) [13514579](https://pubmed.ncbi.nlm.nih.gov/13514579).

1. **[^](#cite_ref-6)** Conover, Donald W.; Kraft, Conrad L. (1958). *The Use of Color in Coding Displays*. Wright Air Development Center, Air Research and Development Command, United States Air Force.

1. ^ [***a***](#cite_ref-Cohen_7-0) [***b***](#cite_ref-Cohen_7-1) See, e.g., Michael Richard Cohen, *Medication Errors* (2007), p. 119.

1. ^ [***a***](#cite_ref-COLE04_8-0) [***b***](#cite_ref-COLE04_8-1) Cole, Barry L (1 July 2004). "The handicap of abnormal colour vision". *Clinical and Experimental Optometry*. **87** (4–5): 258–275. [doi](/source/Doi_(identifier)):[10.1111/j.1444-0938.2004.tb05056.x](https://doi.org/10.1111%2Fj.1444-0938.2004.tb05056.x). [PMID](/source/PMID_(identifier)) [15312030](https://pubmed.ncbi.nlm.nih.gov/15312030).

1. **[^](#cite_ref-9)** ["Color-Coded Loot"](http://giantbomb.com/color-coded-loot/3015-4702/). Giant Bomb. Retrieved 13 June 2016.

## External links

- Media related to [Color code](https://commons.wikimedia.org/wiki/Color_code) at Wikimedia Commons

v t e Color topics Color science Color physics Electromagnetic spectrum Light Rainbow Visible Spectral colors Chromophore Structural coloration Animal coloration Color of chemicals Water Spectral power distribution Colorimetry Color perception Chromesthesia Sonochromatism Color blindness Achromatopsia Dichromacy Color calibration Color constancy Color task Color code Color temperature Color vision test Evolution of color vision Impossible colors Metamerism Opponent process Afterimage Unique hues Tetrachromacy The dress Color psychology Color symbolism Color preferences Lüscher color test Kruithof curve Political color National colors Chromophobia Chromotherapy Color reproduction Color photography Color balance Color cast Digital image processing Color management Color printing Multi-primary color display Quattron Color model additive RGB subtractive CMYK Color space Image color transfer Color philosophy Color scheme Color tool Monochromatic colors Black and white Grisaille Complementary colors Analogous colors Achromatic colors (Neutral) Polychromatic colors Light-on-dark Web colors Tinctures in heraldry Color theory Color mixing Primary color Secondary color Chromaticity Color solid Color wheel Color triangle Color analysis (fashion) Color realism (art style) On Vision and Colours (Schopenhauer) Theory of Colours (Goethe) Color terms Basic English terms Red Orange Yellow Green Blue Purple Pink Brown White Gray Black Cultural differences Linguistic relativity and the color naming debate Blue–green distinction in language Color history Black-and-white dualism Blue in culture Color in Chinese culture Traditional colors of Japan Human skin color Color dimensions Hue Dichromatism Colorfulness Pastel colors Luminance Lightness Darkness Brightness Iridescence Fluorescence Grayscale Tint, shade and tone Color organizations Pantone Color Marketing Group Color Association of the United States International Colour Authority International Commission on Illumination (CIE) International Color Consortium International Colour Association Names Lists Alphabetical List of colors: A–F G–M N–Z Full list List of colors by shade List of color palettes List of color spaces List of Crayola crayon colors history Color chart List of RAL colors List of web colors Shades of: Red Orange Yellow Green Cyan Blue Violet Purple Magenta Pink Brown White Gray Black Related Vision Contrast Qualia Lighting Category Index

Authority control databases: National Czech Republic Israel

---
Adapted from the Wikipedia article [Color code](https://en.wikipedia.org/wiki/Color_code) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Color_code?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
