Menu

Post image 1
Post image 2
Post image 3
1 / 3
0

contrast() | CSS-Tricks

CSS-Tricks·Gabriel Shoyombo·about 1 month ago
#Krhz4S17
Reading 0:00
15s threshold

The CSS  contrast()  filter function increases or decreases the contrast of an element, either making colors pop out more or dulling them to gray. Unlike other filter functions like  brightness()  or  saturate() ,  contrast()  affects both saturation and lightness, keeping only the color’s hue. .low { filter: contrast(50%); } .normal { filter: contrast(100%); } .high { filter: contrast(200%); } The  contrast()  function is defined in the  Filter Effects Module Level 1  specification. Syntax The official syntax for the  contrast()  function is: <contrast()> = contrast( [ <number> | <percentage> ]? ) Or simply: filter: contrast(<amount>); The  contrast()  function is only compatible with the CSS  filter  and  backdrop-filter  properties.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More