Open In App
Related Articles

Tailwind CSS Hue Rotate

Improve Article
Improve
Save Article
Save
Like Article
Like

The hue rotate class is an inbuilt function that is used to apply a filter to the image to set the hue rotation of the image. In CSS, we do that by using the CSS hue-rotate() Function. Tailwind CSS newly added feature brightness in 2.1 version.

Hue Rotate:

  • -hue-rotate-180: This class used to set the hue-rotate quivalent to CSS hue-rotate(-180).
  • -hue-rotate-90: This class used to set the hue-rotate quivalent to CSS hue-rotate(-90).
  • -hue-rotate-60: This class used to set the hue-rotate quivalent to CSS hue-rotate(-60).
  • -hue-rotate-30: This class used to set the hue-rotate quivalent to CSS hue-rotate(-30).
  • -hue-rotate-15: This class used to set the hue-rotate quivalent to CSS hue-rotate(-15).
  • hue-rotate-0: This class used to set the hue-rotate quivalent to CSS hue-rotate(0).
  • hue-rotate-15: This class used to set the hue-rotate quivalent to CSS hue-rotate(15).
  • hue-rotate-30: This class used to set the hue-rotate quivalent to CSS hue-rotate(30).
  • hue-rotate-60: This class used to set the hue-rotate quivalent to CSS hue-rotate(60).
  • hue-rotate-90: This class used to set the hue-rotate quivalent to CSS hue-rotate(90).
  • hue-rotate-180: This class used to set the hue-rotate quivalent to CSS hue-rotate(180).

Syntax: 

<element class="filter hue-rotate-{amount}">..</element>

Example:

HTML




<!DOCTYPE html>
<html>
<head>
    <link href=
"https://unpkg.com/tailwindcss@^2.1/dist/tailwind.min.css"
        rel="stylesheet">
</head>
  
<body class="text-center mx-4 space-y-2">
    <h1 class="text-green-600 text-5xl font-bold">
        GeeksforGeeks
    </h1>
    <b>Tailwind CSS Hue Rotate Class</b>
    <div class="grid grid-flow-col text-center p-4">
        <img class="rounded-lg filter -hue-rotate-180" 
          src=
             alt="image">
        <img class="rounded-lg filter -hue-rotate-60" 
             src=
             alt="image">
        <img class="rounded-lg filter -hue-rotate-0" 
             src=
             alt="image">
        <img class="rounded-lg filter hue-rotate-60" 
             src=
             alt="image">
        <img class="rounded-lg filter hue-rotate-180" 
             src=
             alt="image">
          
    </div>
</body>
  
</html>


Output:


Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 23 Mar, 2022
Like Article
Save Article
Similar Reads
Related Tutorials