mathstodon.xyz is one of the many independent Mastodon servers you can use to participate in the fediverse.
A Mastodon instance for maths people. We have LaTeX rendering in the web interface!

Server stats:

2.7K
active users

#oklab

0 posts0 participants0 posts today
Continued thread

Updated the gradient image generator example to use a custom pixel format (using Oklab color space) for the floating point pixel buffer.

Using Oklab instead of RGB combined with the bicubic image interpolation used to compute the gradient image means the colors will also be interpolated in the Oklab space which is perceptually better & more correct than RGB and leads to more pleasing results...

Demo & source links are updated (see OP)

It's time to put to rest #hex and #rgb() / #rgba() colours in #CSS and embrace the future: #oklch() and #oklab()

* oklch() model: caniuse.com/?search=oklch%28%2
* oklab(): caniuse.com/?search=oklab%28%2

I'm not sure why we still need to add/support lch() and lab() since the ‘okay’ version is the ‘fixed’ version… which is better. Then again, I'm not a #colour expert, hence I can't think of a reason. (Can someone enlighten us, mortals? Thank you!)

Since oklch(), oklab(), lch(), and lab() are still not widely supported (yet), and many end-users are still using an old version of browsers without support, there is #hwb().

As you can see from caniuse.com/?search=hwb%28%29 hwb() is widely supported already. The only browsers still without hwb() support are niche browsers, mainly from China (they don't even support rgb() according to #CanIUse).

* Base #color model: hwb()
* To be future proof: oklch() or oklab()

What I'm more excited about is the #RelativeColor feature from #CSSColor5, but that's for another day.

caniuse.com"oklch()" | Can I use... Support tables for HTML5, CSS3, etc

#ReleaseThursday This is actually the 2nd bunch of #ThingUmbrella releases since the weekend (which I completely forgot to notify about). The main highlights are:

thi.ng/color - added #Oklch support, update #Oklab conversion matrices (to latest spec), updated/improved/fixed CSS color parsing & serializations (more input formats, wider support for using percentages in more places), added serialization options for CSS Color Module Level 4, more docs

thi.ng/hiccup-markdown - major new version w/ completely new & extensible parser to transform #Markdown (with custom extensions[1]) into a proper abstract syntax tree and then transform elements via user defined handlers into arbitrary data structures. The default handlers generate a thi.ng/hiccup tree. More info in the package readme and the readme of this interactive parser & live preview demo: demo.thi.ng/umbrella/markdown/

[1] The syntax extensions include blocks of arbitrary metadata attached to _any_ blocklevel element (e.g. headings, paragraphs, tables, lists etc.) and custom typed blocks of content

As usual, please see changelogs for other updates:

github.com/thi-ng/umbrella/blo

Happy Coding! 😍