forked from orbit-oss/chalk
Meta tweaks
This commit is contained in:
parent
c2311622c3
commit
96f44c976b
5 changed files with 26 additions and 19 deletions
6
source/vendor/ansi-styles/index.js
vendored
6
source/vendor/ansi-styles/index.js
vendored
|
|
@ -105,7 +105,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) {
|
||||
|
|
@ -128,7 +128,7 @@ function assembleStyles() {
|
|||
enumerable: false,
|
||||
},
|
||||
hexToRgb: {
|
||||
value: hex => {
|
||||
value(hex) {
|
||||
const matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
|
||||
if (!matches) {
|
||||
return [0, 0, 0];
|
||||
|
|
@ -157,7 +157,7 @@ function assembleStyles() {
|
|||
enumerable: false,
|
||||
},
|
||||
ansi256ToAnsi: {
|
||||
value: code => {
|
||||
value(code) {
|
||||
if (code < 8) {
|
||||
return 30 + code;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue