Skip to content

Commit 17ecf81

Browse files
committed
util: return buffer
1 parent 880d71e commit 17ecf81

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/util.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function isValidHexColor(hex) {
176176
* Parses a hex color string into RGB components.
177177
* Supports both 3-digit (#RGB) and 6-digit (#RRGGBB) formats.
178178
* @param {string} hex A valid hex color string
179-
* @returns {[number, number, number]} The RGB components
179+
* @returns {Buffer} The RGB components
180180
*/
181181
function hexToRgb(hex) {
182182
// Normalize to 6 digits
@@ -191,9 +191,7 @@ function hexToRgb(hex) {
191191
}
192192

193193
// TODO(araujogui): use Uint8Array.fromHex
194-
const buffer = Buffer.from(hexStr, 'hex');
195-
196-
return [buffer[0], buffer[1], buffer[2]];
194+
return Buffer.from(hexStr, 'hex');
197195
}
198196

199197
/**

0 commit comments

Comments
 (0)