toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return {
    'r': r,
    'g': g,
    'b': b,
    if (a != null) 'a': a,
  };
}