Hsla.fromArgbValue constructor

Hsla.fromArgbValue(
  1. num value
)

Implementation

factory Hsla.fromArgbValue(num value) {
  num a = (value.toInt() & 0xff000000) >> 0x18;
  var r = (value.toInt() & 0xff0000) >> 0x10;
  var g = (value.toInt() & 0xff00) >> 8;
  var b = value.toInt() & 0xff;

  // Convert alpha to 0..1 from (0..255).
  a = double.parse((a / 255).toStringAsPrecision(2));

  return _createFromRgba(r, g, b, a);
}