The Wayback Machine - https://web.archive.org/web/20211016101206/https://www.geeksforgeeks.org/css-hue-rotate-function/
Skip to content
Related Articles

Related Articles

Improve Article

CSS | hue-rotate() Function

  • Last Updated : 08 Aug, 2019

The hue-rotate() function is an inbuilt function which is used to apply a filter to the image to set the hue rotation of the image.

Syntax:

hue-rotate( angle )

Parameters: This function accepts single parameter angle which holds the angle of hue-rotation. A positive hue angle increases the hue value, while a negative angle decreases the hue value.

Below example illustrates the hue-rotate() function in CSS:

Example:




<!DOCTYPE html> 
<html> 
  
<head> 
    <title>CSS hue-rotate() Function</title> 
      
    <style>
        h1 {
            color:green;
        }
        body {
            text-align:center;
        }
        .hue_rotate_effect {
            filter: hue-rotate(100deg);
        }
    </style>
</head> 
  
<body> 
    <h1>GeeksforGeeks</h1> 
      
    <h2>CSS hue-rotate() function</h2>
      
    <img class="hue_rotate_effect" src= 
        alt="GeeksforGeeks logo"> 
</body> 
  
</html>                    

Output:
Image

Supported Browsers: The browsers supported by hue-rotate() function are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera
My Personal Notes arrow_drop_up
Recommended Articles
Page :