Color and Its Properties on the Web: What Is RGB and How to Use It Right?
We break down how to set color for the web, what RGB and HEX are, and how to make sense of those strange combinations of numbers and letters when choosing a color palette.

When they first get into design, many beginners wonder why colors have such strange names — #32A852, #5E2227 and, heaven forbid, #FFFFFF. What is all that, anyway? And why did Figma add a dropdown that lets you choose between RGB, HEX, and other baffling abbreviations? We'll sort that out today, but first let's start with the basics. What is “color”? Color is an element of art and a small part of what creates the aesthetic-usability effect (strictly speaking, it's a “physical phenomenon,” but we'll skip that), and it appears when light hits an object, reflects off it, and travels back to the human eye. Depending on the object's properties, the reflection changes, and we see one color or another. That's settled, so let's move on.
What Are RGB, HSL, HEX, and CSS?
RGB, HSL, HEX, and CSS are essentially color notation schemes. A person can understand which color you mean if you give them its common name: blue, black, white, and so on. Computers can't!
Imagine we're designing a mobile interface in Figma and want to recolor a button “Japanese Blue.” But we can't just type the color's name like that, because the program doesn't understand our language. To make sure the computer gets the color right, we use schemes like RGB, HSL, HEX, and so on. To avoid overloading you with extra information at the start, this article covers only RGB. With this one scheme as an example, everything will fall into place.
How Pixels Relate to RGB
Let's start simple. RGB stands for red, green, blue. These are the names of the primary colors that make up the system. The thing is, images on computer screens (or TVs, iPads, and so on) are made up of lots of tiny colored dots. These dots are called “pixels,” and the number of pixels on a screen of a given size is its “resolution.” The smaller the pixel and the more of them on the screen, the better the image quality.
You can think of each pixel as a set of three blocks. One block handles red, the second green, and the third blue. Mixing all three produces the final color on the screen. The image below shows how a pixel relates to the RGB system.

A pixel in the RGB system
How Is RGB Different from HEX?
In essence, there's no fundamental difference between the RGB and HEX systems. They're different ways of expressing the same thing: red, green, and blue values. The biggest difference is in what will ultimately use the color: websites, an app, vector graphics, or print materials. For the most part, web products use the HEX system, while printers and other similar devices often rely on RGB.
What Is a HEX Code?
Every color has a HEX code, for example, #12BE46. HEX means “6” (anyone who studied math and physics knows what we mean). In other words, a color code in the HEX system consists of 6 characters. To write the code, we use the hexadecimal number system. What sets it apart is that it uses the digits 0 to 9 and the letters “A” to “F.” That gives 16 different values in total.
The image below shows what a HEX code means. The first two characters stand for red, followed by green and then blue. The scale works like this: “0” means no light at all (picture a TV that's switched off), and “F” (that is, 15) means full color saturation.

HEX code
Let's see how this works in practice! The code #FF0000 means pure red, because the first characters, the ones responsible for red, are set to FF, which means maximum saturation (by the way, we recently covered how to work with bright colors in an interface). The remaining characters, which are responsible for green and blue, are set to 0, meaning no saturation whatsoever. By the same logic, #00FF00 should be pure green and #0000FF pure blue. The image below shows the result.

Pure red, green, and blue
And what happens if all three colors are left at zero (no saturation), that is, #000000? You get black, like a switched-off TV or, say, a dark theme in an interface. And if all three colors are at maximum saturation (that is, #FFFFFF)? Then you get pure white.

Pure white and black
Using Color in UI/UX Design
Every UX/UI designer's project is made up of many colors. To handle them well, it's important not only to sort all colors into 4 big groups but also to know which colors are trending this year.
Primary colors. These are the colors used most often in the interface, the ones that make the product distinctive. As a rule, they're the colors a brand picks for its identity. What color do you associate with Facebook? Blue, obviously. Now go to their site and you'll see that all the key elements are blue. That's the primary color.
Secondary colors. They're there to accent or complement the primary color. This keeps the interface balanced and makes the most important things stand out. As a rule, a site or app can have 1–6 secondary colors.
Neutral colors (neutrals). They include shades of gray, from white to black. Most of any interface is made up of them. Neutral colors are most often used for backgrounds, text color, and so on.
Semantic colors. These are colors that signal standard states, such as “success” (green), “error” (red), or “warning” (orange). Each color carries the same basic meaning in every context.

Semantic colors
Looking Back
So, we've covered what RGB is, how to use a HEX code, and what it actually means. Keep in mind that this kind of knowledge matters a lot for any designer: you can't just use a color picker and hope that ready-made palettes will supply the colors for your project. You need to understand how a given color comes about. That gives you a solid foundation for building harmonious color schemes in large projects.
Source: Bootcamp
Article updated
.jpg&w=3840&q=75)
%2520-%2520hover.jpg&w=3840&q=75)



