Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      May 9, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      May 9, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      May 9, 2025

      How To Prevent WordPress SQL Injection Attacks

      May 9, 2025

      Your password manager is under attack, and this new threat makes it worse: How to defend yourself

      May 9, 2025

      EcoFlow’s new backyard solar energy system starts at $599 – no installation crews or permits needed

      May 9, 2025

      Why Sonos’ cheapest smart speaker is one of my favorites – even a year after its release

      May 9, 2025

      7 productivity gadgets I can’t live without (and why they make such a big difference)

      May 9, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Tap into Your PHP Potential with Free Projects at PHPGurukul

      May 9, 2025
      Recent

      Tap into Your PHP Potential with Free Projects at PHPGurukul

      May 9, 2025

      Preparing for AI? Here’s How PIM Gets Your Data in Shape

      May 9, 2025

      A Closer Look at the AI Assistant of Oracle Analytics

      May 9, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      kew v3.2.0 improves internet radio support and more

      May 9, 2025
      Recent

      kew v3.2.0 improves internet radio support and more

      May 9, 2025

      GNOME Replace Totem Video Player with Showtime

      May 9, 2025

      Placemark is a web-based tool for geospatial data

      May 9, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»Why is Nobody Using the hwb() Color Function?

    Why is Nobody Using the hwb() Color Function?

    May 7, 2025

    Okay, nobody is an exaggeration, but have you seen the stats for hwb()? They show a steep decline, and after working a lot on color in the CSS-Tricks almanac, I’ve just been wondering why that is.

    Chrome Platform Status for hwb(), showing a steep decline in usage from 0.4 percent of all page loads in 2024 to less than .2 perfect in 2025.

    hwb() is a color function in the sRGB color space, which is the same color space used by rgb(), hsl() and the older hexadecimal color format (e.g. #f8a100). hwb() is supposed to be more intuitive and easier to work with than hsl(). I kinda get why it’s considered “easier” since you specify how much black or white you want to add to a given color. But, how is hwb() more intuitive than hsl()?

    hwb() accepts three values, and similar to hsl(), the first value specifies the color’s hue (between 0deg–360deg), while the second and third values add whiteness (0 – 100) and blackness (0 – 100) to the mix, respectively.

    According to Google, the term “intuitive” means “what one feels to be true even without conscious reasoning; instinctive.” As such, it does truly seem that hwb() is more intuitive than hsl(), but it’s only a slight notable difference that makes that true.

    Let’s consider an example with a color. We’ll declare light orange in both hsl() and hwb():

    /* light orange in hsl */
    .element-1 {
      color: hsl(30deg 100% 75%);
    }
    
    /* light orange in hwb() */
    .element-2 {
      color: hwb(30deg 50% 0%);
    }

    These two functions produce the exact same color, but while hwb() handles ligthness with two arguments, hsl() does it with just one, leaving one argument for the saturation. By comparison, hwb() provides no clear intuitive way to set just the saturation. I’d argue that makes the hwb() function less intuitive than hsl().

    I think another reason that hsl() is generally more intuitive than hwb() is that HSL as a color model was created in the 1970s while HWB as a color model was created in 1996. We’ve had much more time to get acquainted with hsl() than we have hwb(). hsl() was implemented by browsers as far back as 2008, Safari being the first and other browsers following suit. Meanwhile, hwb() gained support as recently as 2021! That’s more than a 10-year gap between functions when it comes to using them and being familiar with them.

    There’s also the fact that other color functions that are used to represent colors in other color spaces — such as lab(), lch(), oklab(), and oklch() — offer more advantages, such as access to more colors in the color gamut and perceptual uniformity. So, maybe being intuitive is coming at the expense of having a more robust feature set, which could explain why you might go with a less intuitive function that doesn’t use sRGB.

    Look, I can get around the idea of controlling how white or black you want a color to look based on personal preferences, and for designers, it’s maybe easier to mix colors that way. But I honestly would not opt for this as my go-to color function in the sRGB color space because hsl() does something similar using the same hue, but with saturation and lightness as the parameters which is far more intuitive than what hwb() offers.

    I see our web friend, Stefan Judis, preferring hsl() over hwb() in his article on hwb().

    Lea Verou even brought up the idea of removing hwb() from the spec in 2022, but a decision was made to leave it as it was since browsers were already implementing the function. And although,I was initially pained by the idea of keeping hwb() around, I also quite understand the feeling of working on something, and then seeing it thrown in the bin. Once we’ve introduced something, it’s always tough to walk it back, especially when it comes to maintaining backwards compatibility, which is a core tenet of the web.

    I would like to say something though: lab(), lch(), oklab(), oklch() are already here and are better color functions than hwb(). I, for one, would encourage using them over hwb() because they support so many more colors that are simply missing from the hsl() and hwb() functions.

    I’ve been exploring colors for quite some time now, so any input would be extremely helpful. What color functions are you using in your everyday website or web application, and why?

    More on color

    Almanac

    on

    Feb 22, 2025


    hsl()


    .element { color: hsl(90deg, 50%, 50%); }

    color


    Sunkanmi Fafowora

    Almanac

    on

    Mar 4, 2025


    lab()


    .element { color: lab(50% 50% 50% / 0.5); }

    color


    Sunkanmi Fafowora

    Almanac

    on

    Mar 12, 2025


    lch()


    .element { color: lch(10% 0.215 15deg); }

    color


    Sunkanmi Fafowora

    Almanac

    on

    Apr 29, 2025


    oklab()


    .element { color: oklab(25.77% 25.77% 54.88%; }

    color


    Sunkanmi Fafowora

    Almanac

    on

    Apr 3, 2025


    oklch()


    .element { color: oklch(70% 0.15 240); }

    color


    Gabriel Shoyombo


    Why is Nobody Using the hwb() Color Function? originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleMicrosoft: April updates cause Windows Server auth issues
    Next Article On-Scroll 3D Carousel

    Related Posts

    News & Updates

    Your password manager is under attack, and this new threat makes it worse: How to defend yourself

    May 9, 2025
    News & Updates

    EcoFlow’s new backyard solar energy system starts at $599 – no installation crews or permits needed

    May 9, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    Disaster Recovery and Business Continuity Plan

    News & Updates

    Customizing Data Transformations with Laravel Casts

    Development

    CVE-2024-58134 – Mojolicious Default HMAC Session Secret Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Xbox’s mobile aspirations may finally come to fruition as a U.S. judge just banned Apple from restricting developers’ payment systems on iOS

    News & Updates

    Highlights

    Artificial Intelligence

    Last Week in AI #295 – AlphaFold 3 open sourced, AI improvement slows, Donald Trump and AI

    November 12, 2024

    Top News Google DeepMind open-sources AlphaFold 3, ushering in a new era for drug discovery…

    The upcoming Ray-Ban Meta smart glasses may feature the display upgrade we’ve been hoping for

    December 23, 2024

    Singapore Inks Deal with Oracle for “Isolated” Cloud Computing and AI Services

    March 19, 2025

    New XM Cyber Research: 80% of Exposures from Misconfigurations, Less Than 1% from CVEs

    May 17, 2024
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.