Apply XO fixes

This commit is contained in:
LitoMore 2022-10-10 00:37:51 +08:00
parent 629d4e4890
commit ef53fde412
No known key found for this signature in database
GPG key ID: B8653F9344667340

View file

@ -104,7 +104,7 @@ function assembleStyles() {
// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js
Object.defineProperties(styles, {
rgbToAnsi256: {
value: (red, green, blue) => {
value(red, green, blue) {
// We use the extended greyscale palette here, with the exception of
// black and white. normal palette only has 4 greyscale shades.
if (red === green && green === blue) {
@ -127,7 +127,7 @@ function assembleStyles() {
enumerable: false,
},
hexToRgb: {
value: hex => {
value(hex) {
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
if (!matches) {
return [0, 0, 0];
@ -156,7 +156,7 @@ function assembleStyles() {
enumerable: false,
},
ansi256ToAnsi: {
value: code => {
value(code) {
if (code < 8) {
return 30 + code;
}