rgb to hexadecimal color calculator




result:

the value of rgb is 16 multiplied by the first digit of hex plus the second digit of hex. the rgb and hex numbers below 10 are the same. the difference is that hex is a two-digit number. just add 0 in front. 10 corresponds to a, 11 corresponds to b, 12 corresponds to c, 13 corresponds to d, 14 corresponds to e, and 15 corresponds to f. the following is an example to illustrate the conversion method from rgb to hex.

example 1:rgb(11,111,222)=#??????

11÷16=0 more than 11. 11 corresponds to b and is preceded by 0. then the hex data is 0b.

111÷16=6 more than 15. 15 corresponds to f. then the hex data is 6f.

222÷16=13 more than 14. 13 corresponds to d and 14 corresponds to e. then the data of hex is de

the combined data of hex is #0b6fde