+ DEFINE_STATIC_LOCAL(const String, commaSpace, (", "));
+ DEFINE_STATIC_LOCAL(const String, rgbaParen, ("rgba("));
+ DEFINE_STATIC_LOCAL(const String, zeroPointZero, ("0.0"));
+
+ if (!hasAlpha()) {
+ StringBuilder builder;
+ builder.reserveCapacity(7);
+ builder.append('#');
+ appendByteAsHex(red(), builder, Lowercase);
+ appendByteAsHex(green(), builder, Lowercase);
+ appendByteAsHex(blue(), builder, Lowercase);
+ return builder.toString();
+ }
+
+ Vector<UChar> result;
+ result.reserveInitialCapacity(28);
+
+ append(result, rgbaParen);
+ appendNumber(result, red());
+ append(result, commaSpace);
+ appendNumber(result, green());
+ append(result, commaSpace);
+ appendNumber(result, blue());
+ append(result, commaSpace);