resolveColor static method

CSSColor? resolveColor(
  1. String color,
  2. RenderStyle renderStyle,
  3. String propertyName
)

Implementation

static CSSColor? resolveColor(String color, RenderStyle renderStyle, String propertyName) {
  if (color == CURRENT_COLOR) {
    if (propertyName == COLOR) {
      return null;
    }
    // Update property that deps current color.
    renderStyle.addColorRelativeProperty(propertyName);
    return renderStyle.color;
  }
  Color? value = parseColor(color, renderStyle: renderStyle);
  if (value == null) {
    return null;
  }
  return CSSColor(value);
}