Class SvgColor
java.lang.Object
com.android.ide.common.vectordrawable.SvgColor
public class SvgColor
extends java.lang.Object
Methods for converting SVG color values to vector drawable format.
-
Method Summary
Modifier and Type Method Description protected static java.lang.StringcolorSvg2Vd(java.lang.String svgColorValue)Converts an SVG color value to "#RRGGBB" or "#AARRGGBB" format used by vector drawables.
-
Method Details
-
colorSvg2Vd
protected static java.lang.String colorSvg2Vd(java.lang.String svgColorValue)Converts an SVG color value to "#RRGGBB" or "#AARRGGBB" format used by vector drawables. The input color value can be "none" and RGB value, e.g. "rgb(255, 0, 0)", "rgba(255, 0, 0, 127)", or a color name defined in https://www.w3.org/TR/SVG11/types.html#ColorKeywords.- Parameters:
svgColorValue- the SVG color value to convert- Returns:
- the converted value, or null if the given value cannot be interpreted as color
- Throws:
java.lang.IllegalArgumentException- if the supplied SVG color value has invalid or unsupported format
-