HEX vs. RGB vs. HSL Explained
HEX and RGB both describe a color as a mix of red, green, and blue light intensities — HEX is just a compact hexadecimal shorthand for the same three RGB values — while HSL describes a color instead by hue (the base color itself, as a position on a color wheel), saturation (how intense or muted it is), and lightness (how close to black or white it is), which often maps more intuitively onto how people actually think about adjusting a color.
All three ultimately describe the exact same set of possible colors — they just organize the underlying information differently.
Why HEX and RGB are really the same thing
A HEX code like #4F46E5 is simply three two-digit hexadecimal numbers concatenated together, each representing the intensity (0-255) of red, green, and blue respectively — converting between HEX and RGB is a direct, lossless numeric conversion, not a change in what's actually being described.
Why HSL feels more intuitive for adjustments
Because HSL separates hue from intensity, you can lighten or darken a color by adjusting a single lightness value, or make it more vivid or muted by adjusting saturation alone — doing the equivalent adjustment in RGB requires changing all three red, green, and blue values in a less obvious, coordinated way.