When we use styles object
const colors = {
white: [5,5,5],
red: [5,0,0],
};
const styles = {
bad: function (str) {
this
.bold()
.rgb(colors.red, 1)
.rgb(colors.white)
.text(str)
.reset();
},
};
with color variable and want to use red color twice, it inverted in blue after first attempt
Imgur
Looks like _rgb2dec return reversed value in this case and then it overwrite color.red array.
I found a temporary solution to do without red color in the color object
const colors = {
white: [5,5,5],
};
const styles = {
bad: function (str) {
this
.bold()
.rgb([5,0,0], 1)
.rgb(colors.white)
.text(str)
.reset();
},
};
When we use styles object
with color variable and want to use red color twice, it inverted in blue after first attempt
Imgur
Looks like
_rgb2decreturn reversed value in this case and then it overwrite color.red array.I found a temporary solution to do without red color in the color object