CSS filters allow us to manipulate the color of an element in different ways.
The
brightness()
CSS function is used with the filter
property, and it looks like this:
filter: brightness(20%);
The brightness()
function modifies the illumination of an image. Values are declared as either a percentage or a number without a unit, for example, 10%
and 0.5%
A value of 100%
leaves the element unchanged; a value of 0%
makes the element completely black. Values over 100%
are allowed and create a more intense effect. There is no limit to the value.
A value of 1
leaves the element unchanged; a value of 0
makes the element completely black. Values over 1
are allowed and create a more intense effect. There is no limit to the value. Also, negative values are not valid for either the percentage of the number.
CSS:
.element { filter: brightness(20%); }