title | slug | page-type | browser-compat |
---|---|---|---|
invert() |
Web/CSS/filter-function/invert |
css-function |
css.types.filter-function.invert |
{{CSSRef}}
The invert()
CSS function inverts the color samples in the input image. Its result is a {{cssxref("<filter-function>")}}.
{{EmbedInteractiveExample("pages/css/function-invert.html")}}
invert(amount)
amount
- : The amount of the conversion, specified as a {{cssxref("<number>")}} or a {{cssxref("<percentage>")}}. A value of
100%
is completely inverted, while a value of0%
leaves the input unchanged. Values between0%
and100%
are linear multipliers on the effect. The initial value for {{Glossary("interpolation")}} is0
.
- : The amount of the conversion, specified as a {{cssxref("<number>")}} or a {{cssxref("<percentage>")}}. A value of
invert(0) /* No effect */
invert(.6) /* 60% inversion */
invert(100%) /* Completely inverted */
{{Specifications}}
{{Compat}}
The other {{cssxref("<filter-function>")}} functions available to be used in values of the {{cssxref("filter")}} and {{cssxref("backdrop-filter")}} properties include:
- {{cssxref("filter-function/blur", "blur()")}}
- {{cssxref("filter-function/brightness", "brightness()")}}
- {{cssxref("filter-function/contrast", "contrast()")}}
- {{cssxref("filter-function/drop-shadow", "drop-shadow()")}}
- {{cssxref("filter-function/grayscale", "grayscale()")}}
- {{cssxref("filter-function/hue-rotate", "hue-rotate()")}}
- {{cssxref("filter-function/opacity", "opacity()")}}
- {{cssxref("filter-function/saturate", "saturate()")}}
- {{cssxref("filter-function/sepia", "sepia()")}}