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