Signed-off-by: Richie Bendall <richiebendall@gmail.com>
This commit is contained in:
Richie Bendall 2021-04-22 00:50:59 +12:00
parent 07bb6e90f8
commit b0e338a3a7
No known key found for this signature in database
GPG key ID: 94AE1ACB662A2A6D

View file

@ -73,8 +73,6 @@ styles.visible = {
};
const getModelAnsi = (model, level, type, ...arguments_) => {
level = levelMapping[level];
if (model === 'rgb') {
if (level === 'ansi16m') {
return ansiStyles[type].ansi16m(...arguments_);
@ -101,7 +99,7 @@ for (const model of usedModels) {
get() {
const {level} = this;
return function (...arguments_) {
const styler = createStyler(getModelAnsi(model, level, 'color', ...arguments_), ansiStyles.color.close, this._styler);
const styler = createStyler(getModelAnsi(model, levelMapping[level], 'color', ...arguments_), ansiStyles.color.close, this._styler);
return createBuilder(this, styler, this._isEmpty);
};
}
@ -112,7 +110,7 @@ for (const model of usedModels) {
get() {
const {level} = this;
return function (...arguments_) {
const styler = createStyler(getModelAnsi(model, level, 'bgColor', ...arguments_), ansiStyles.bgColor.close, this._styler);
const styler = createStyler(getModelAnsi(model, levelMapping[level], 'bgColor', ...arguments_), ansiStyles.bgColor.close, this._styler);
return createBuilder(this, styler, this._isEmpty);
};
}