CSS Hue Rotate Filter Generator
The filter: hue-rotate() function rotates the hue of every pixel in an element along the HSL colour wheel by a specified angle value, leaving saturation and lightness unchanged while shifting the chromatic component uniformly.
1. hue-rotate()deg
.image {
filter: hue-rotate(90deg);
}

Functions run top to bottom, in the order written. Your image stays in your browser; it is not uploaded.
hue-rotate() from 0 to 360 degrees with a live preview
Original and filtered previews side by side
Add saturate() or brightness() in the same rule
Try it on your own image; nothing is uploaded
- Cost
- Free tier
- Sign-up
- Not required
- Processing
- Tool-specific
- Privacy
- Clearly disclosed
Add this Filter Effects Builder to your website
Drop the Filter Effects Builder into a blog post, product docs, intranet, or school portal with one iframe. Processing, privacy, and usage limits are the same as on the full tool page.
- One copy-ready line of HTML
- Responsive — adapts to any container width
- No API credentials are placed in the snippet
Embed code
<iframe
src="https://www.fixtools.io/css-tool/filter-effects-builder?embed=1"
width="100%"
height="780"
frameborder="0"
style="border:0;border-radius:16px;max-width:900px;"
title="Filter Effects Builder by FixTools"
loading="lazy"
allow="clipboard-write"
></iframe>Attribution-friendly: a small "Powered by FixTools" link appears in the embed footer.
Degree Values, Colour Wheel Cycling, and SVG Icon Recolouring with hue-rotate()
The hue-rotate() function accepts an angle value where deg, rad, turn, and grad are all valid units, though in practice deg is universal in production code because most colour wheel references and design tools use degrees. The rotation is applied in the HSL colour model: the hue component of every pixel shifts by the specified angle while saturation and lightness remain unchanged. A pixel at hue 0 (red) rotated by 120deg becomes hue 120 (green). A pixel at hue 200 (blue) rotated by 120deg becomes hue 320 (magenta). Because all pixels shift by the same angle, the relative hue relationships between colours in the element are preserved. A multicolour illustration rotated by 90deg still contains the same variety of colours, but all shifted 90 degrees around the wheel, which keeps the original colour harmony intact.
SVG icon recolouring is one of the most practical uses of hue-rotate() in production codebases. A single SVG icon file using a specific fill colour can be shifted to any other hue by calculating the degree difference between the source hue and the target hue in the HSL model and using that difference as the hue-rotate() value. For a blue icon at approximately 210deg hue that should appear green at approximately 120deg hue, the rotation is 360 + 120 - 210 = 270deg, or equivalently -90deg. This calculation eliminates the need for separate coloured icon assets or SVG use elements with different CSS variables, particularly useful for icon libraries with many colour variants where shipping duplicate asset files for each colour would be expensive and tedious to maintain over time.
Animating hue-rotate() creates a continuous colour cycling effect that is popular for hero accents and decorative elements. A @keyframes block from hue-rotate(0deg) to hue-rotate(360deg) with animation-iteration-count: infinite and animation-timing-function: linear produces a smooth, constant colour cycle. Applied to a gradient background, logo mark, or decorative illustration, this creates the rainbow shift effect seen on many modern SaaS landing pages and personal portfolio sites. The computational cost is low because hue-rotate() is a per pixel matrix operation without spatial sampling, similar in cost to sepia() and grayscale(). Combining hue-rotate with saturate(1.2) in the same filter declaration keeps the colours vivid throughout the cycle, preventing them from looking washed out at hue positions that map to less saturated rendered colours due to display gamut limitations.
hue-rotate() interacts with other filter functions in order dependent ways worth understanding when building complex stacks. Applying sepia() before hue-rotate() first warms the image to a brown monochrome and then shifts the entire result around the colour wheel, producing a tinted monochrome in any chosen hue: sepia(1) hue-rotate(120deg) produces a green tinted monochrome, sepia(1) hue-rotate(240deg) produces a blue tinted monochrome. Reversing the order changes the result because hue-rotate() applied first to a coloured image alters the input that sepia() then receives, which produces a different mapping. Use the up and down arrows in the tool to change the order of the function rows and watch the filtered preview, instead of editing CSS by hand, which is faster when exploring tinted monochrome variations across an icon set or photographic content.
How to use this tool
The tool starts with hue-rotate(90deg) on a colourful sample illustration. Drag the degree slider and watch every colour shift around the colour wheel together. Add saturate() if the result looks dull, then copy the rule.
How It Works
Step-by-step guide to css hue rotate filter generator:
- 1
Set the rotation
Drag the hue-rotate slider or type a value in degrees. 0deg and 360deg leave the colours unchanged; 180deg moves each hue to roughly its opposite.
- 2
Check the colours you care about
Hue rotation shifts every colour by the same angle, so check the result on your own image with Your image. Greys, black and white do not change hue.
- 3
Add saturate() or brightness() if needed
Add saturate() from the list to make the shifted colours stronger or weaker, or brightness() to adjust the overall tone. To cycle colours continuously, animate the hue-rotate value with your own @keyframes rule.
- 4
Copy the CSS
Click Copy CSS. The output is a complete rule you can paste into your stylesheet; rename the .image selector to match your element.
Real-world examples
Common situations where this approach makes a real difference:
SVG icon colour variants from a single file
A design system has a single set of SVG icons in the primary blue brand colour. The system needs red, green, and amber icon variants for status indicators across the dashboard product. Rather than creating separate coloured SVG files for every status and every icon, a developer calculates the hue difference from the source blue to each target colour and applies filter: hue-rotate(Xdeg) to dedicated status icon classes. Three CSS rules replace what would otherwise require dozens of additional SVG files that designers would have to update each time the base icon set changed, making the system far easier to maintain.
Rainbow gradient cycling on a landing page logo mark
A SaaS product launch page uses an SVG logo mark with a coloured gradient fill to convey product energy on the hero. The developer wants the logo to cycle through colours as a subtle but distinctive visual accent that loops indefinitely while the visitor remains on the page. They apply filter: hue-rotate(0deg) saturate(1.15) at rest and add an animation cycling from hue-rotate(0deg) to hue-rotate(360deg) over six seconds with linear timing and infinite iteration count. The saturate addition keeps colours vivid throughout the cycle on monitors with narrower colour gamuts where some hue positions can otherwise look muted compared to the source colours.
Hover complementary colour flip on a call-to-action button
A marketing team wants the primary CTA button to flip to its complementary colour on hover as a visual hook that draws attention without changing the button position or content layout. A developer applies filter: hue-rotate(0deg) at rest and filter: hue-rotate(180deg) on :hover with transition: filter 0.3s ease applied to the base rule. The 180 degree rotation produces the exact complementary colour for any brand palette without needing a second colour variable, custom property override, or modifier class. The single transition value covers every button on the site that shares the class, keeping the implementation small.
CSS-only colour theme switcher prototype
A developer prototyping a theme switcher for a web app applies filter: hue-rotate(var(--theme-hue)) to the main content wrapper element. A range input slider in the developer console controls --theme-hue via a JavaScript event listener that updates the CSS custom property on the documentElement. All coloured elements on the page shift simultaneously across the whole layout, giving a realistic preview of the entire UI in any hue variant without maintaining separate theme stylesheets or duplicate component rule blocks. The prototype is sufficient for stakeholder review meetings where direction must be chosen before committing real theme values to the design system.
Pro tips
Get better results with these expert suggestions:
Use hue-rotate on a CSS gradient for a live colour theme preview
Apply filter: hue-rotate() to a container with a CSS gradient background. Changing the degree value from a range input via JavaScript instantly previews the gradient in any hue variant without recomputing the underlying gradient colour stops manually. This is a fast prototyping technique for exploring brand colour palettes against a real layout, especially when stakeholders want to see the same composition in multiple colour directions during a design review. Once a target hue is agreed, the developer can hardcode the equivalent gradient colours and remove the filter to ship cleaner production CSS.
hue-rotate() does not affect achromatic colours
Pure black, white, and grey have no hue component in the HSL model because their saturation is zero, so the colour wheel rotation has nothing to act on. hue-rotate() does not change these pixels regardless of the degree value supplied. An element that is entirely greyscale will look identical at any hue-rotate() value, which is a common source of confusion when developers first apply hue-rotate to a monochrome SVG icon and see no change. Combine with sepia() or another tinting function before hue-rotate() in the filter stack if you want the rotation to affect achromatic source content.
Scope hue-rotate to a container for site-wide theme switching
Applying filter: hue-rotate(var(--theme-hue, 0deg)) to the body or a main content wrapper and changing --theme-hue via JavaScript creates a site wide colour theme toggle driven from a single CSS variable update. All images, icons, and coloured elements shift together in lockstep, producing a consistent theme preview without maintaining multiple colour theme stylesheets or duplicating component rules. This is excellent for prototype phases when stakeholders are still choosing a final brand hue, though for production it is usually better to commit to specific colour values rather than rely on filter based theming because the filter affects every coloured pixel uniformly.
Layer hue-rotate with grayscale for coloured monochrome effects
filter: grayscale(1) hue-rotate(Xdeg) does not produce coloured output because grayscale removes all hue information before hue-rotate operates on the pixels downstream in the filter chain. For a tinted monochrome effect, use sepia(1) first to introduce a warm hue, then hue-rotate() to shift that hue to the target colour: filter: sepia(1) hue-rotate(90deg) produces a green tinted monochrome, sepia(1) hue-rotate(200deg) produces a cool blue tinted monochrome, and sepia(1) hue-rotate(300deg) produces a magenta tinted monochrome. This is the standard CSS technique for any tinted monochrome treatment when the source content includes coloured imagery.
Calculate the hue difference to target a specific colour
Find the HSL hue of the source colour and the target colour. Subtract the source hue from the target hue, wrapping negative values by adding 360. Use this difference as the hue-rotate() degree value. This gives you a specific recolour rather than a trial-and-error rotation.
Use hue-rotate(180deg) for complementary colour effects
A 180-degree rotation shifts every colour to its complementary hue on the colour wheel. Applied to a logo or icon, this produces a complementary colour version without creating a separate asset. Combine with a CSS transition for a hover effect that flips between primary and complementary brand colours.
Add saturate(1.1) to maintain vividness during hue cycling
Some hue positions appear less saturated on screen due to monitor colour profiles and rendering differences. Pairing filter: hue-rotate() with saturate(1.1) compensates for this, keeping colours evenly vivid throughout a full cycle animation.
Frequently asked questions
Related guides
More use-case guides for the same tool:
Related tools
Other tools you might find useful:
Ready to get started?
Open Filter Effects Builder to review its free limits and processing method.
Open Filter Effects Builder →Free tier · No account needed · Transparent limits