color property Null safety
The color to use when stroking or filling a shape.
Defaults to opaque black.
See also:
- style, which controls whether to stroke or fill (or both).
- colorFilter, which overrides color.
- shader, which overrides color with more elaborate effects.
This color is not used when compositing. To colorize a layer, use colorFilter.
Implementation
Color get color {
final int encoded = _data.getInt32(_kColorOffset, _kFakeHostEndian);
return Color(encoded ^ _kColorDefault);
}
Implementation
set color(Color value) {
assert(value != null);
final int encoded = value.value ^ _kColorDefault;
_data.setInt32(_kColorOffset, encoded, _kFakeHostEndian);
}