Colors & Codes#

Reference of color-encoding standards an operator works with, ANSI / xterm terminal palettes, web color models, paint classifications, and adversary / discipline-specific color conventions (TLP, defcon, conditions).

ANSI / terminal escape colors#

Sequence

Color

033[30m

black (foreground)

033[31m

red

033[32m

green

033[33m

yellow

033[34m

blue

033[35m

magenta

033[36m

cyan

033[37m

white

033[90m

bright black (gray)

033[91m

bright red

033[92m

bright green

033[93m

bright yellow

033[94m

bright blue

033[95m

bright magenta

033[96m

bright cyan

033[97m

bright white

033[40m…033[47m

background colors (matches foreground codes)

033[100m…033[10

7m bright background.

033[38;5;Nm

256-color foreground (N = 0-255).

033[48;5;Nm

256-color background.

033[38;2;R;G;Bm

24-bit truecolour foreground.

033[48;2;R;G;Bm

24-bit truecolour background.

033[0m

reset.

033[1m

bold.

033[2m

dim.

033[3m

italic.

033[4m

underline.

033[5m

blink (rare).

033[7m

reverse video.

033[9m

strikethrough.

Web / HTML color#

Form

Notes

Hex 6-digit

#RRGGBB; #FFAA00 = orange.

Hex 3-digit

#RGB; expanded to #RRGGBB.

Hex 8-digit

#RRGGBBAA; with alpha.

rgb()

rgb(255, 170, 0) or rgb(255 170 0) (CSS Color 4).

rgba()

rgb(255 170 0 / 50%) modern syntax.

hsl()

hue (0-360°) saturation lightness.

hwb()

hue whiteness blackness.

lch(), oklch()

perceptual color spaces; CSS Color 4.

color()

per-color-space (sRGB, display-p3, rec2020, …).

color-mix()

CSS Color 5; mix two colors.

CSS named colors (selection)#

Name

Hex

black

#000000

white

#FFFFFF

red

#FF0000

lime

#00FF00

blue

#0000FF

yellow

#FFFF00

cyan / aqua

#00FFFF

magenta / fuchsia

#FF00FF

silver

#C0C0C0

gray

#808080

maroon

#800000

green

#008000

navy

#000080

purple

#800080

orange

#FFA500

crimson

#DC143C

gold

#FFD700

indigo

#4B0082

teal

#008080

olive

#808000

salmon

#FA8072

coral

#FF7F50

khaki

#F0E68C

There are 147 CSS named colors from CSS Color 4. rebeccapurple (#663399) was added in 2014 in memory of Eric Meyer’s daughter.

Pantone / industrial systems#

System

Notes

Pantone PMS

spot color reference for printing.

RAL

European industrial / signage color.

NCS

Natural Color System (Scandinavia).

Munsell

scientific color-classification.

Federal Std 595

US gov color standard (FED-STD-595B/C).

BS381C

UK British Standard.

JIS Z 8721

Japanese industrial.

Cybersecurity / threat color conventions#

Convention

Notes

TLP

Traffic Light Protocol; sharing constraints:

  • TLP:CLEAR (formerly WHITE), unrestricted.

  • TLP:GREEN, community-wide.

  • TLP:AMBER, limited; on a need-to-know.

  • TLP:AMBER+STRICT, recipient’s org only.

  • TLP:RED, named recipients only.

DEFCON

US DoD readiness states (5 normal, 1 max alert). See conditions below.

HPCON

Health Protection Condition (DoD pandemic).

INFOCON / CYBERCON

US DoD info-ops conditions; 1 (highest) -> 5 (normal).

HSAS

US Homeland Security Advisory (deprecated 2011); was Green / Blue / Yellow / Orange / Red.

NTAS

successor to HSAS; Bulletin / Elevated / Imminent.

US Threat Levels

UK MI5: Low / Moderate / Substantial / Severe / Critical. AU: Negligible / Low / Probable / Expected / Certain.

DHS / FEMA HazCon

Hurricane condition: 5 normal, 1 imminent landfall.

Other operational color codes#

System

Notes

Hospital codes

Code Blue (cardiac), Code Red (fire), Code White (violent person), Code Black (bomb), Code Pink (infant abduction), Code Silver (active shooter), Code Yellow (mass casualty); per-jurisdiction varies.

Aviation alerts

Notams + ATIS; not color-coded.

Maritime

IALA buoyage: red / green channel-marker schemes; the “red right returning” rule (US / region B) reverses in region A (EU / Africa / India).

Military map / OPS

blue = friendly, red = hostile, green = neutral, yellow = unknown (NATO APP-6).

TSA / FEMA

color-coded baggage tags etc.

US RAM-W

USACE site-vulnerability color scale.

US PROBLEM

lab biosafety: BSL-1 (low) -> BSL-4 (max).

DEFCON levels#

Level

Notes

DEFCON 5

Normal peacetime.

DEFCON 4

Above normal; intelligence watch + measures.

DEFCON 3

Air Force ready in 15 min; greater readiness.

DEFCON 2

Armed forces ready for action in 6 h.

DEFCON 1

Maximum readiness; nuclear war imminent / underway.

The US has only publicly entered DEFCON 2 (Cuban Missile Crisis, 1962; Yom Kippur War, 1973).

Operator notes#

  • TLP is the standard for CTI sharing; embed in every shared document. Mistakes here are operational, not just cosmetic.

  • Truecolour terminals are universal in modern terminal emulators; legacy workflows still expect 8 / 16 / 256 color.

  • WCAG color contrast, 4.5:1 (AA) / 7:1 (AAA) for body text against background.

  • Color-blind audiences, don’t rely on color alone for meaning; pair with shape / label.

  • Region B vs A buoyage, US / Canada / Caribbean / Korea / Philippines / Japan use IALA-B (red right returning); the rest of the world uses IALA-A (red left).

  • No DEFCON color, DEFCON levels are numeric, not color-coded; the “DEFCON color chart” online is fiction.

References#