sRgbToLab function

LabColor sRgbToLab(
  1. SRgbColor rgb, {
  2. String? illuminant,
  3. String observer = '2',
})

Converts SRgbColor directly to LabColor.

By default, Lab is computed in sRGB's native illuminant (D65), matching Python colormath's behavior.

Implementation

LabColor sRgbToLab(
  SRgbColor rgb, {
  String? illuminant,
  String observer = '2',
}) => xyzToLab(rgbToXyz(rgb, targetIlluminant: illuminant, observer: observer));