saturate()
In CSS, the saturate()
function increases or decreases the color intensity of an element.
Syntax
filter: saturate(<value>);
The required <value>
can either be a positive decimal number or a positive percentage number, such as (but not limited to):
- Decimal value:
0
,0.5
,1.0
,1.5
, … - Percentage value:
0%
,50%
,100%
,150%
, …
Note: The value defaults to
1
or100%
, leaving the target element unchanged. Higher values will increase the saturation. A value of0
or0%
will remove all the colors, leaving the element completely unsaturated. Negative values are not allowed.
Example
The following example sets the saturation of a color to 50%
and 1.5
(or 150%
):
.logo-image-2 {filter: saturate(50%);}.logo-image-3 {filter: saturate(1.5);}
Here is the output for the above example:
Here, the first image shows the original saturation at saturate(100%)
, the second image is less saturated at saturate(50%)
, and the last image is more saturated with saturate(1.5)
.
All contributors
- chrisleond111 total contribution
- christian.dinh2476 total contributions
- Anonymous contributorAnonymous contributor3071 total contributions
- robgmerrill124 total contributions
- chrisleond11
- christian.dinh
- Anonymous contributor
- robgmerrill
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.