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 880d71e commit 17ecf81Copy full SHA for 17ecf81
lib/util.js
@@ -176,7 +176,7 @@ function isValidHexColor(hex) {
176
* Parses a hex color string into RGB components.
177
* Supports both 3-digit (#RGB) and 6-digit (#RRGGBB) formats.
178
* @param {string} hex A valid hex color string
179
- * @returns {[number, number, number]} The RGB components
+ * @returns {Buffer} The RGB components
180
*/
181
function hexToRgb(hex) {
182
// Normalize to 6 digits
@@ -191,9 +191,7 @@ function hexToRgb(hex) {
191
}
192
193
// TODO(araujogui): use Uint8Array.fromHex
194
- const buffer = Buffer.from(hexStr, 'hex');
195
-
196
- return [buffer[0], buffer[1], buffer[2]];
+ return Buffer.from(hexStr, 'hex');
197
198
199
/**
0 commit comments