Convert exact red, green, and blue channel values into one hex color.

Example

Convert three exact color channels to a hex color.

highlighted = computed this step

Step 1 — RGB channels

Set up the exact input values.

RGB(64, 128, 255)\begin{array}{c|c}\text{RGB}&\text{(64, 128, 255)}\end{array}

Step 2 — Red hex

Compute the highlighted value.

red(64, 40)\begin{array}{c|c}\text{red}&\hlmath{\text{(64, 40)}}\end{array}

Step 3 — Green hex

Compute the highlighted value.

green(128, 80)\begin{array}{c|c}\text{green}&\hlmath{\text{(128, 80)}}\end{array}

Step 4 — Blue hex

Compute the highlighted value.

blue(255, FF)\begin{array}{c|c}\text{blue}&\hlmath{\text{(255, FF)}}\end{array}

Step 5 — Hex color

State the final color.

hex color#4080FF\begin{array}{c|c}\text{hex color}&\hlmath{\text{\#4080FF}}\end{array}
rgb-and-hex An RGB color stores three integer channels. Hex notation writes each channel as a two-digit base-sixteen pair.