What is CSS Relative Color Syntax Generator?
CSS relative color syntax lets you start from an existing color and modify its channels individually. Using rgb(from color r g b / alpha) or hsl(from color h s l / alpha) syntax, you can adjust lightness, saturation, alpha, or individual channels. This is more powerful than color-mix() for precise channel manipulation.
Quick answer
CSS relative color syntax lets you create a new color by adjusting individual channels of an existing color. It is more powerful than color-mix() for precise channel-level manipulation without a preprocessor.
Limitations
- Browser support requires Chrome 119+, Safari 16.4+, and Firefox 128+. Older browsers will ignore the declaration entirely.
- The syntax varies slightly by color space. Not all channels are available in every color space, and channel value ranges differ.
- Complex nested relative color expressions can hurt readability. Use a CSS custom property for the base color to keep declarations clean.
How to use this tool
- Enter a base color in hex, RGB, or HSL format.
- Choose the output color space and the channel adjustments.
- The tool generates the relative color syntax CSS.
- Copy the declaration into your stylesheet.
What you can use it for
- Create semi-transparent variants of a brand color.
- Generate a lighter or darker shade by adjusting the lightness channel.
- Boost or reduce saturation for hover and active states.