Make Beautiful Gradients

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. Scrawl-canvas

    Responsive, interactive and more accessible HTML5 canvas elements. Scrawl-canvas is a JavaScript library designed to make using the HTML5 canvas element easier, and more fun

    Just before Christmas I got an urge to add a dither filter to my JS canvas library. The past few weeks have certainly been a very intense adventure through a very deep rabbit hole involving color spaces, color distances and discovering how to generate a best-fit reduced palette of colors and then dither it (hello, blue noise!)

    I finally managed to complete the work last week and I'm quite happy with the results. Using the library people can set the colors of graphical objects or gradients using any CSS color space string (RGB, HSL, HWB, LAB, LCH) and the color should render as expected. The reduce-noise filter uses LAB internally to calculate color distances, but in the end I compromised and used euler distances for the algorithm rather than one of the more modern algorithms.

    Work is still on a branch in the library[1] but I'm hoping to merge it into the main code in the next week or so (after testing across devices/screens/etc).

    Aside: Safari has gone ahead and introduced support for HWB, LAB and LCH color strings in CSS. Sadly, they're not recognised by Safari's canvas engine (yet). Also, their HSL and HWB gradients seem to be the same as the RGB gradients; their LAB/LCH gradients seem to dodge the dreaded Gray Zone.

    [1] - https://github.com/KaliedaRik/Scrawl-canvas/tree/dec-21-dith...

  2. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  3. csswg-drafts

    CSS Working Group Editor Drafts

    As the article says, the core problem is CSS interpolates in RGB colorspace. CSS Color 4 seems to have adapted a color space parameter for interpolation in its drafts. See discussion here: https://github.com/w3c/csswg-drafts/issues/5833

  4. hsluv

    Human-friendly HSL, website and math

    > Now, HSL isn't necessarily the best color mode to use in every situation; it tends to produce gradients that can be overly bright and vivid, because it doesn't take into account human perception.

    Shout-out to to [HSLUV](https://www.hsluv.org/) which does exactly that.

  5. palettize

    Palette generator using k-means clustering with CIELAB colors

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Ask HN: What are you working on this year?

    1 project | news.ycombinator.com | 1 Jan 2024
  • Pixelating Live with SVG

    1 project | news.ycombinator.com | 24 Dec 2023
  • Scrawl-canvas 2D canvas library – proposed roadmap

    1 project | news.ycombinator.com | 28 May 2023
  • Scrawl-canvas - a Javascript library for working with the HTML5 <canvas> element

    1 project | /r/javascript | 2 Mar 2023
  • [AskJS] Why do my coworkers not see the value in frameworks?

    2 projects | /r/javascript | 15 Nov 2022

Did you know that JavaScript is
the 3rd most popular programming language
based on number of references?