color property

Object get color

An array of four integers in the range 0,255 that make up the RGBA color of the badge. For example, opaque red is [255, 0, 0, 255]. Can also be a string with a CSS value, with opaque red being #FF0000 or #F00.

Implementation

Object get color => _wrapped.color.when(
      isString: (v) => v,
      isOther: (v) => (v as $js_browser_action.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>')
  };
}