π Introduction
The saturate() function in CSS is part of the filter() property. It controls the **color intensity (saturation)** of an element β higher saturation makes colors more vivid, lower saturation makes them dull or greyish. Perfect for image effects, UI hover states, animations, and dynamic color adjustments. πβ¨
π― What Does saturate() Do?
- Increases or decreases color saturation
- Accepts values in percentages or numbers
- Works with images, backgrounds, videos, and any element
- Can be combined with other filter() functions
β¨ Syntax
Syntax
selector {
filter: saturate(<amount>);
}Note
π§© Accepted Values
1. Decimal (Number)
1 = normal, <1 reduces saturation, >1 increases saturation.
Number Values
filter: saturate(0); /* fully desaturated */
filter: saturate(0.5); /* 50% saturation */
filter: saturate(2); /* 200% saturation */2. Percentage (%)
100% = normal, 0% = grey, >100% = oversaturated.
Percentage Values
filter: saturate(0%); /* grayscale */
filter: saturate(150%); /* +50% more saturation */π₯ Practical Examples
1. Making an Image More Vibrant
Vibrant Image
.vibrant {
filter: saturate(180%);
}2. Desaturating an Image on Hover
Hover Desaturation
.image:hover {
filter: saturate(40%);
transition: 0.3s ease;
}3. Hover to Increase Saturation
Hover Saturation
.card:hover {
filter: saturate(2);
}4. Combined Filters (Saturate + Contrast + Brightness)
Combined Effects
.effect {
filter: saturate(150%) contrast(120%) brightness(110%);
}5. Completely Removing Color
Zero Saturation
.grey {
filter: saturate(0);
}π Comparison Table
| Value | Effect |
|---|---|
| 0 | Fully desaturated (grey) |
| 0.5 / 50% | Less vibrant colors |
| 1 / 100% | Normal saturation |
| 2 / 200% | Highly vibrant colors |
π§ Tips & Best Practices
- Use saturate(0) to create grayscale effects
- Avoid oversaturation for UI elementsβuse moderately
- Combine with
transitionfor smooth hover animations - Great for image galleries, buttons, cards, and interactive effects
- Use percentage for readability in design systems
π Conclusion
The saturate() CSS function gives you fine control over the vibrancy of any element. Whether you're building a grayscale hover effect, a bright and bold image gallery, or combining multiple filters for artistic impact β saturate() is a versatile and powerful tool in your CSS filter toolkit. π