Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Red has been inverted to blue #8

Open
whoisYeshua opened this issue Nov 16, 2020 · 0 comments
Open

Red has been inverted to blue #8

whoisYeshua opened this issue Nov 16, 2020 · 0 comments

Comments

@whoisYeshua
Copy link

whoisYeshua commented Nov 16, 2020

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();
    },
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant