For those just learning about perceptual colour spaces, I’d recommend exploring OKLab which is simpler to implement and overcomes some of the problems of CIELab.
If you ever need to generate a gradient between colors in any of your code, interpolating colors in the Lab color space is an awesome option. A simple linear interpolation of the components gives impressively beautiful results.
(Although, like several other commenters, I do recommend OKLab.)
This article describes how to convert from the sRGB color space, not RGB.
sRGB like Lab* is device independent so a transformation between the two is possible.
RGB on the other hand is device dependent, and would therefore require a device ICC Profile to convert to Lab*.
To people who aren't yet aware also: https://bottosson.github.io/posts/oklab/
For those just learning about perceptual colour spaces, I’d recommend exploring OKLab which is simpler to implement and overcomes some of the problems of CIELab.
https://bottosson.github.io/posts/oklab/
If you ever need to generate a gradient between colors in any of your code, interpolating colors in the Lab color space is an awesome option. A simple linear interpolation of the components gives impressively beautiful results.
(Although, like several other commenters, I do recommend OKLab.)
A practical application is pie charts, apologies for the XSLT:
* https://repo.autonoma.ca/repo/delibero/blob/HEAD/source/xsl/...
* https://repo.autonoma.ca/repo/delibero/blob/HEAD/source/xsl/...
An example pie chart is on page 33, section 9.2.3:
* https://repo.autonoma.ca/repo/delibero/raw/HEAD/docs/manual/...
* https://i.ibb.co/ymDLcPNj/pie-chart.png (screenshot)
The colours are harmonious, visually distinct, and not hard-coded to a fixed number of slices.