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

      Google’s Agent2Agent protocol finds new home at the Linux Foundation

      June 23, 2025

      Decoding The SVG path Element: Curve And Arc Commands

      June 23, 2025

      This week in AI dev tools: Gemini 2.5 Pro and Flash GA, GitHub Copilot Spaces, and more (June 20, 2025)

      June 20, 2025

      Gemini 2.5 Pro and Flash are generally available and Gemini 2.5 Flash-Lite preview is announced

      June 19, 2025

      Summer Game Fest had a bit of a “weird” vibe this year — an extremely mixed bag of weak presentations and interesting titles

      June 24, 2025

      The Lenovo Legion Go 2 gets its first release date tease, which could be accurate — but treat with the biggest pinch of salt

      June 24, 2025

      Denmark will stick with Windows — government still plans to ditch Microsoft Office

      June 24, 2025

      OneDrive user locked out of “30 years worth of photos and work” without any support — calls Microsoft a “Kafkaesque black hole”

      June 24, 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

      Best PHP Project for Final Year Students: Learn, Build, and get Successful with PHPGurukul

      June 24, 2025
      Recent

      Best PHP Project for Final Year Students: Learn, Build, and get Successful with PHPGurukul

      June 24, 2025

      Community News: Latest PECL Releases (06.24.2025)

      June 24, 2025

      JSON module scripts are now Baseline Newly Available

      June 24, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Summer Game Fest had a bit of a “weird” vibe this year — an extremely mixed bag of weak presentations and interesting titles

      June 24, 2025
      Recent

      Summer Game Fest had a bit of a “weird” vibe this year — an extremely mixed bag of weak presentations and interesting titles

      June 24, 2025

      The Lenovo Legion Go 2 gets its first release date tease, which could be accurate — but treat with the biggest pinch of salt

      June 24, 2025

      Denmark will stick with Windows — government still plans to ditch Microsoft Office

      June 24, 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

    Summer Game Fest had a bit of a “weird” vibe this year — an extremely mixed bag of weak presentations and interesting titles

    June 24, 2025
    News & Updates

    The Lenovo Legion Go 2 gets its first release date tease, which could be accurate — but treat with the biggest pinch of salt

    June 24, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    How global threat actors are weaponizing AI now, according to OpenAI

    News & Updates

    8BitDo’s translucent green keyboard is an “ode to the OG Xbox” — Now at its lowest-ever price for an Amazon-adjacent deal

    News & Updates

    A Coding Implementation to Build an Interactive Transcript and PDF Analysis with Lyzr Chatbot Framework

    Machine Learning

    CVE-2025-5265 – “Firefox Windows Local Code Execution Vulnerability”

    Common Vulnerabilities and Exposures (CVEs)

    Highlights

    CVE-2025-32408 – Soffid Console Java Deserialization Remote Code Execution

    April 21, 2025

    CVE ID : CVE-2025-32408

    Published : April 21, 2025, 1:15 p.m. | 45 minutes ago

    Description : In Soffid Console 3.5.38 before 3.5.39, necessary checks were not applied to some Java objects. A malicious agent could possibly execute arbitrary code in the Sync Server and compromise security.

    Severity: 8.5 | HIGH

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    A Developer’s Guide to Protecting Personal Data: Best Practices and Tools

    April 17, 2025

    DeepMind’s latest research at NeurIPS 2022

    May 27, 2025

    CVE-2025-4752 – D-Link DI-7003GV2 Remote Information Disclosure Vulnerability

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

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