Why use RGB or hex instead of base-10 for colors? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Why use RGB or hex instead of base-10 for colors?

RGB uses base-255, hexadecimal uses base-16, and colors like "Red" in an IDE are translated to base-2 binary. Why not just use base-10 (zero to nine) to represent colors? i.e. the base-10 number 99999 is the same as navy blue. I made a code to show you can easily convert base-10 to base-255 or base-16. https://code.sololearn.com/c5WjGQ7RYL8I/#py

26th Jun 2017, 2:25 PM
Frederik Bussler
Frederik Bussler - avatar
2 Answers
+ 7
Taken from https://cheeze.club/7c4r Hex values are easier to copy and paste from your favourite image editor. RGB values are easier to manipulate with Javascript.
26th Jun 2017, 2:48 PM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar
+ 1
@cheeze Spam... 😂
26th Jun 2017, 3:32 PM
Ekansh