toRgbColor method

RgbColor toRgbColor()

Implementation

RgbColor toRgbColor() {
  // To xyz color
  num x = _toXyz(a / 500 + (l + 16) / 116, 95.047) / 100;
  num y = _toXyz((l + 16) / 116, 100) / 100;
  num z = _toXyz((l + 16) / 116 - b / 200, 108.883) / 100;

  // To rgb color
  num rgbR = _toRgb(x * 3.2406 + y * -1.5372 + z * -0.4986);
  num rgbG = _toRgb(x * -0.9689 + y * 1.8758 + z * 0.0415);
  num rgbB = _toRgb(x * 0.0557 + y * -0.2040 + z * 1.0570);

  return RgbColor(rgbR, rgbG, rgbB);
}