tezvyn:

RGB vs. HSL: Two Ways to Tell a Computer 'Color'

Source: developer.mozilla.orgbeginner

RGB tells a computer how to mix light (Red, Green, Blue), while HSL describes color how humans perceive it (Hue, Saturation, Lightness). Use RGB for brand colors and HSL for intuitive variations. The footgun is creating low-contrast UIs that are unreadable.

RGB is a recipe for screens, mixing Red, Green, and Blue light. HSL is more intuitive, describing color by Hue (the color itself), Saturation (vibrancy), and Lightness (brightness). Use RGB for exact brand colors; use HSL to programmatically create variations like a button that gets 10% lighter on hover. The biggest footgun is creating low-contrast UIs that are unreadable for users with low vision.

Read the original → developer.mozilla.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

RGB vs. HSL: Two Ways to Tell a Computer 'Color' · Tezvyn