Function: color-oklab-to-xyz

color-oklab-to-xyz is a byte-compiled function defined in compat-30.el.

Signature

(color-oklab-to-xyz L A B)

Documentation

[Compatibility function for color-oklab-to-xyz, defined in Emacs 30.1. See
(compat) Emacs 30.1' for more details.]

Convert the OkLab color represented by L A B to CIE XYZ. Oklab is a perceptual color space created by Björn Ottosson
<https://bottosson.github.io/posts/oklab/>. It has the property that changes in
the hue and saturation of a color can be made while maintaining the same perceived lightness.

Source Code

;; Defined in ~/.emacs.d/elpa/compat-30.1.0.1/compat-30.el
;;;; Defined in color.el

(compat-defun color-oklab-to-xyz (l a b) ;; <compat-tests:color-oklab-to-xyz>
  "Convert the OkLab color represented by L A B to CIE XYZ.
Oklab is a perceptual color space created by Björn Ottosson
<https://bottosson.github.io/posts/oklab/>.  It has the property that
changes in the hue and saturation of a color can be made while maintaining
the same perceived lightness."
  :feature color
  (let ((ll (expt (+ (* 1.0 l) (* 0.39633779 a) (* 0.21580376 b)) 3))
        (mm (expt (+ (* 1.00000001 l) (* -0.10556134 a) (* -0.06385417 b)) 3))
        (ss (expt (+ (* 1.00000005 l) (* -0.08948418 a) (* -1.29148554 b)) 3)))
    (list (+ (* ll 1.22701385) (* mm -0.55779998) (* ss 0.28125615))
          (+ (* ll -0.04058018) (* mm 1.11225687) (* ss -0.07167668))
          (+ (* ll -0.07638128) (* mm -0.42148198) (* ss 1.58616322)))))