Skip to content

Commit ae5cba3

Browse files
committed
util: return buffer
1 parent 0d319ad commit ae5cba3

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

lib/util.js

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

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

200198
/**

0 commit comments

Comments
 (0)