operator [] method
- int index
override
This method is an override of the index operator.
If the requested index is not in the table (i.e., it results in null
), the method returns this
,
presumably the default color.
index
The index of the color swatch to return. Must be a non-negative integer.
Returns the color at the specified swatch index, or the default color if the index is not in the table.
Implementation
@override
Color? operator [](int index) => super[brightness == Brightness.dark ? 110 - index : index] ?? this;