tryParserCSSColorWithVariable static method
String
tryParserCSSColorWithVariable(
- String fullColor,
- String input,
- RenderStyle renderStyle,
- String propertyName,
Implementation
static String tryParserCSSColorWithVariable(
String fullColor, String input, RenderStyle renderStyle, String propertyName) {
String replaced = input.replaceAllMapped(_variableRgbRegExp, (Match match) {
String? varString = match[0];
if (varString == null) return '';
var variable = renderStyle.resolveValue(propertyName, varString);
if (variable is CSSVariable) {
String? resolved = renderStyle.getCSSVariable(variable.identifier, propertyName + '_' + fullColor)?.toString();
return resolved ?? '';
}
return '';
});
return replaced;
}