In CSS, you can apply the hue-rotate effect using the filter property. The hue-rotate effect allows you to shift the colors of an element along the color wheel, resulting in a change of hue while keeping the same saturation and lightness values. It's a way to create interesting color variations or animations in your web designs.
Here's how you can use the hue-rotate effect in CSS:
.hue-rotate-element {
filter: hue-rotate(90deg);
}
in this example:
You can adjust the angle value (in degrees) to control the amount and direction of the hue rotation. Positive values rotate the colors clockwise, while negative values rotate them counterclockwise.
Here's another example with partial grayscale:
.hue-rotate-element-2 {
filter: hue-rotate(-45deg);
}
In this case, the .hue-rotate-element-2 class applies a hue-rotate effect with a -45-degree angle, resulting in a counterclockwise shift of colors.
The hue-rotate effect is a creative way to manipulate and animate colors on your web page, adding visual interest and variety to your designs.
Select Language
Set theme
© 2024 ReadyTools. All rights reserved.