Common CSS color formats
Hex, RGB, HSL, and named colors are supported broadly. Modern CSS also supports formats such as OKLCH, which can help produce smoother and more perceptually balanced palettes.
Where CSS colors are used
CSS color values can style text, backgrounds, borders, outlines, shadows, gradients, scrollbars, accent colors, SVG fills, and canvas-driven interfaces.
Choosing readable colors
A color can look attractive and still fail as text. Use contrast checks for foreground and background combinations, especially for buttons, navigation, forms, and cards.
Related color tools
Use these tools to pick, convert, test, and export the color values described in this guide.
More color guides
Color GuidesPractical guides for HTML color codes, Hex values, RGB, HSL, CSS colors, palettes, web safe colors, and shades.HTML Color CodesLearn how HTML color codes work and copy Hex, RGB, HSL, OKLCH, named colors, and CSS-ready color values.Hex Color CodesA guide to Hex color codes, six-digit #RRGGBB values, shorthand Hex colors, and Hex to RGB conversion.RGB Color CodesUnderstand RGB color codes, convert RGB to Hex, and use rgb() values in CSS.HSL Color CodesLearn HSL color codes, hue angles, saturation, lightness, and how to use hsl() in CSS.Color Palette GeneratorGenerate color palettes from a base color, image, color wheel, harmony, shades, tints, and tones.Web Safe ColorsExplore web safe colors, classic browser-safe palettes, Hex values, and modern alternatives.Color Shades GeneratorCreate color shades, tints, tones, and variations from any Hex, RGB, HSL, or OKLCH color.