Given RGB =
R:
776644,
G:
B:
Calculate hex code and hue.
Calculate Piece 1 of the Red portion:
Red Piece 1 = | Red - Red mod 16 |
| 16 |
Red Piece 1 = | 776644 - 776644 mod 16 |
| 16 |
Check our
modulus lesson776644 mod 16 = 4
Red Piece 1 = | 776644 - 4 |
| 16 |
Red Piece 1 = 48540
In the string
0123456789ABCDEFWe use position 48540 =
Calculate Piece 2 of the Red portion:
Red Piece 2 =
Red mod 16
Red Piece 2 =
776644 mod 16
Red Piece 2 = 4
In the string
0123456789ABCDEFWe use position 4 =
4Calculate Piece 1 of the Green portion:
Green Piece 1 = | Green - Green mod 16 |
| 16 |
Green Piece 1 = | - mod 16 |
| 16 |
Check our
modulus lesson mod 16 = 0
Green Piece 1 = 0
In the string
0123456789ABCDEFWe use position 0 =
0Calculate Piece 2 of the Green portion:
Green Piece 2 =
Green mod 16
Green Piece 2 =
mod 16
Green Piece 2 = 0
In the string
0123456789ABCDEFWe use position 0 =
0Calculate Piece 1 of the Blue portion:
Blue Piece 1 = | Blue - Blue mod 16 |
| 16 |
Blue Piece 1 = | - mod 16 |
| 16 |
Check our
modulus lesson mod 16 = 0
Blue Piece 1 = 0
In the string
0123456789ABCDEFWe use position 0 =
0Calculate Piece 2 of the Blue portion:
Blue Piece 2 =
Blue mod 16
Blue Piece 2 =
mod 16
Blue Piece 2 = 0
In the string
0123456789ABCDEFWe use position 0 =
0Our final RGB to HEX conversion is below:
R:
776644,
G:
,
B:
→ =
=
4 =
0 =
0 =
0 =
0Calculate Hue for RGB = (776644, , )
Since
R ≥
G ≥
B, we are in the Red-Yellow region and the formula is below:
h = 0°