l RGB and HEX conversions Calculator
RGB to HEXHEX to RGB
<-- RED
<-- GREEN
<-- BLUE

Enter RGB


Given RGB = R:100, G:150B:230
Calculate hex code and hue.

Calculate Piece 1 of the Red portion:

Red Piece 1  =  Red - Red mod 16
  16

Red Piece 1  =  100 - 100 mod 16
  16

Check our modulus lesson
100 mod 16 = 4
Red Piece 1  =  100 - 4
  16

Red Piece 1  =  96
  16

Red Piece 1 = 6
In the string 0123456789ABCDEF
We use position 6 = 6

Calculate Piece 2 of the Red portion:

Red Piece 2 = Red mod 16
Red Piece 2 = 100 mod 16
Red Piece 2 = 4

In the string 0123456789ABCDEF
We use position 4 = 4

Calculate Piece 1 of the Green portion:

Green Piece 1  =  Green - Green mod 16
  16

Green Piece 1  =  150 - 150 mod 16
  16

Check our modulus lesson
150 mod 16 = 6
Green Piece 1  =  150 - 6
  16

Green Piece 1  =  144
  16

Green Piece 1 = 9
In the string 0123456789ABCDEF
We use position 9 = 9

Calculate Piece 2 of the Green portion:

Green Piece 2 = Green mod 16
Green Piece 2 = 150 mod 16
Green Piece 2 = 6

In the string 0123456789ABCDEF
We use position 6 = 6

Calculate Piece 1 of the Blue portion:

Blue Piece 1  =  Blue - Blue mod 16
  16

Blue Piece 1  =  230 - 230 mod 16
  16

Check our modulus lesson
230 mod 16 = 6
Blue Piece 1  =  230 - 6
  16

Blue Piece 1  =  224
  16

Blue Piece 1 = 14
In the string 0123456789ABCDEF
We use position 14 = E

Calculate Piece 2 of the Blue portion:

Blue Piece 2 = Blue mod 16
Blue Piece 2 = 230 mod 16
Blue Piece 2 = 6

In the string 0123456789ABCDEF
We use position 6 = 6

Our final RGB to HEX conversion is below:

R:100, G:150, B:230 → = 6 = 4 = 9 = 6 = E = 6

Calculate Hue for RGB = (100, 150, 230)

Since B > G > R, we are in the Cyan-Blue region and the formula is below:
h  =  60°(4B - 5(R) - G)
  B - R

h  =  60°(4(230) - 5(100) - 230)
  230 - 100

h  =  190
  130

h