return rgbToHex(r as number, g, b!) + alphaToHex(a!);
}
+/**
+ * Returns the textual representation of a RGBA value.
+ *
+ * @since 5.5
+ */
+export function rgbaToString(rgba: RGBA): string {
+ return `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`;
+}
+
export interface RGB {
r: number;
g: number;
hexToRgb,
hsvToRgb,
rgbaToHex,
+ rgbaToString,
rgbToHex,
rgbToHsv,
};
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
- exports.rgbaToHex = exports.rgbToHex = exports.hexToRgb = exports.rgbToHsv = exports.hsvToRgb = void 0;
+ exports.rgbaToString = exports.rgbaToHex = exports.rgbToHex = exports.hexToRgb = exports.rgbToHsv = exports.hsvToRgb = void 0;
/**
* Converts a HSV color into RGB.
*
return rgbToHex(r, g, b) + alphaToHex(a);
}
exports.rgbaToHex = rgbaToHex;
+ /**
+ * Returns the textual representation of a RGBA value.
+ *
+ * @since 5.5
+ */
+ function rgbaToString(rgba) {
+ return `rgba(${rgba.r}, ${rgba.g}, ${rgba.b}, ${rgba.a})`;
+ }
+ exports.rgbaToString = rgbaToString;
// WCF.ColorPicker compatibility (color format conversion)
window.__wcf_bc_colorUtil = {
hexToRgb,
hsvToRgb,
rgbaToHex,
+ rgbaToString,
rgbToHex,
rgbToHsv,
};