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