MsMaterialColor.fromARGB constructor

MsMaterialColor.fromARGB(
  1. int a,
  2. int r,
  3. int g,
  4. int b,
)

Construct a MsMaterialColor from the lower 8 bits of four integers.

  • a is the alpha value, with 0 being transparent and 255 being fully opaque.
  • r is red, from 0 to 255.
  • g is green, from 0 to 255.
  • b is blue, from 0 to 255.

Out of range values are brought into range using modulo 255.

Implementation

factory MsMaterialColor.fromARGB(int a, int r, int g, int b) =>
    MsMaterialColor((((a & 0xff) << 24) |
            ((r & 0xff) << 16) |
            ((g & 0xff) << 8) |
            ((b & 0xff) << 0)) &
        0xFFFFFFFF);