readColor function

Vector4? readColor(
  1. Map<String, PropertyValue> props,
  2. String key
)

Reads a ColorValue as a Vector4 (RGBA), or returns fallback.

Implementation

Vector4? readColor(Map<String, PropertyValue> props, String key) {
  final v = props[key];
  return v is ColorValue ? Vector4(v.r, v.g, v.b, v.a) : null;
}