BaseRandomColor constructor

BaseRandomColor({
  1. int? a,
  2. int? r,
  3. int? g,
  4. int? b,
})

Same as Color.fromARGB, if parameter has value, lock that value

Implementation

BaseRandomColor({int? a, int? r, int? g, int? b})
    : super(((((a ?? Random().nextInt(256)) & 0xff) << 24) |
              (((r ?? Random().nextInt(256)) & 0xff) << 16) |
              (((g ?? Random().nextInt(256)) & 0xff) << 8) |
              (((b ?? Random().nextInt(256)) & 0xff) << 0)) &
          0xFFFFFFFF);