Skip to content

Commit f91cba8

Browse files
committed
util: return buffer
1 parent 404d907 commit f91cba8

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
@@ -132,7 +132,7 @@ function isValidHexColor(hex) {
132132
* Parses a hex color string into RGB components.
133133
* Supports both 3-digit (#RGB) and 6-digit (#RRGGBB) formats.
134134
* @param {string} hex A valid hex color string
135-
* @returns {[number, number, number]} The RGB components
135+
* @returns {Buffer} The RGB components
136136
*/
137137
function hexToRgb(hex) {
138138
// Normalize to 6 digits
@@ -147,9 +147,7 @@ function hexToRgb(hex) {
147147
}
148148

149149
// TODO(araujogui): use Uint8Array.fromHex
150-
const buffer = Buffer.from(hexStr, 'hex');
151-
152-
return [buffer[0], buffer[1], buffer[2]];
150+
return Buffer.from(hexStr, 'hex');
153151
}
154152

155153
/**

0 commit comments

Comments
 (0)