toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() => bind != null
    ? {'bind': bind, 'opacity': opacity}
    : {
        'hex': hex,
        'dark': dark,
        'opacity': opacity,
        // Omitted entirely for ordinary colours, so the wire shape and every
        // consumer of it stay unchanged unless a system colour is asked for.
        if (system != null) 'system': system!.name,
      };