Skip to content

Commit

Permalink
fix: don't append the end thing when colour is disabled
Browse files Browse the repository at this point in the history
I didn't test it in a terminal where colour is actually unavailable but I assume that end string would appear
  • Loading branch information
eartharoid committed Feb 15, 2023
1 parent 3523d3d commit 73c91d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export function short(t: string) {
const bigint = parseInt(code, 16);
const [r, g, b] = [(bigint >> 16) & 255, (bigint >> 8) & 255, bigint & 255];
return `\x1b[${match.includes('!') ? '48' : '38'};2;${r};${g};${b}m`;
}) + '\x1b[0m'
}) + (colorsEnabled ? '\x1b[0m' : '');
}

/**
Expand Down

0 comments on commit 73c91d7

Please sign in to comment.