color property

Object get color

An array of four integers in the range 0-255 that make up the RGBA color of the badge. Can also be a string with a CSS hex color value; for example, #FF0000 or #F00 (red). Renders colors at full opacity.

Implementation

Object get color => _wrapped.color.when(
      isString: (v) => v,
      isOther: (v) =>
          (v as $js.ColorArray).toDart.cast<int>().map((e) => e).toList(),
    );
set color (Object v)

Implementation

set color(Object v) {
  _wrapped.color = switch (v) {
    String() => v.jsify()!,
    List<int>() => v.toJSArray((e) => e),
    _ => throw UnsupportedError(
        'Received type: ${v.runtimeType}. Supported types are: String, List<int>')
  };
}