We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 404d907 commit f91cba8Copy full SHA for f91cba8
lib/util.js
@@ -132,7 +132,7 @@ function isValidHexColor(hex) {
132
* Parses a hex color string into RGB components.
133
* Supports both 3-digit (#RGB) and 6-digit (#RRGGBB) formats.
134
* @param {string} hex A valid hex color string
135
- * @returns {[number, number, number]} The RGB components
+ * @returns {Buffer} The RGB components
136
*/
137
function hexToRgb(hex) {
138
// Normalize to 6 digits
@@ -147,9 +147,7 @@ function hexToRgb(hex) {
147
}
148
149
// TODO(araujogui): use Uint8Array.fromHex
150
- const buffer = Buffer.from(hexStr, 'hex');
151
-
152
- return [buffer[0], buffer[1], buffer[2]];
+ return Buffer.from(hexStr, 'hex');
153
154
155
/**
0 commit comments