Update index.js
This commit is contained in:
parent
8bb26539ff
commit
f3669da6b4
1 changed files with 4 additions and 2 deletions
|
|
@ -73,6 +73,8 @@ styles.visible = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getModelAnsi = (model, level, type, ...arguments_) => {
|
const getModelAnsi = (model, level, type, ...arguments_) => {
|
||||||
|
level = levelMapping[level];
|
||||||
|
|
||||||
if (model === 'rgb') {
|
if (model === 'rgb') {
|
||||||
if (level === 'ansi16m') {
|
if (level === 'ansi16m') {
|
||||||
return ansiStyles[type].ansi16m(...arguments_);
|
return ansiStyles[type].ansi16m(...arguments_);
|
||||||
|
|
@ -99,7 +101,7 @@ for (const model of usedModels) {
|
||||||
get() {
|
get() {
|
||||||
const {level} = this;
|
const {level} = this;
|
||||||
return function (...arguments_) {
|
return function (...arguments_) {
|
||||||
const styler = createStyler(getModelAnsi(model, levelMapping[level], 'color', ...arguments_), ansiStyles.color.close, this._styler);
|
const styler = createStyler(getModelAnsi(model, level, 'color', ...arguments_), ansiStyles.color.close, this._styler);
|
||||||
return createBuilder(this, styler, this._isEmpty);
|
return createBuilder(this, styler, this._isEmpty);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -110,7 +112,7 @@ for (const model of usedModels) {
|
||||||
get() {
|
get() {
|
||||||
const {level} = this;
|
const {level} = this;
|
||||||
return function (...arguments_) {
|
return function (...arguments_) {
|
||||||
const styler = createStyler(getModelAnsi(model, levelMapping[level], 'bgColor', ...arguments_), ansiStyles.bgColor.close, this._styler);
|
const styler = createStyler(getModelAnsi(model, level, 'bgColor', ...arguments_), ansiStyles.bgColor.close, this._styler);
|
||||||
return createBuilder(this, styler, this._isEmpty);
|
return createBuilder(this, styler, this._isEmpty);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue