Skip to content

Red has been inverted to blue #8

Description

@whoisYeshua

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();
    },
};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions