Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

allow fg, bg, attributes to be set for all colors in color_config #489

Merged
merged 2 commits into from
Dec 14, 2021
Merged

allow fg, bg, attributes to be set for all colors in color_config #489

merged 2 commits into from
Dec 14, 2021

Conversation

fdncred
Copy link
Contributor

@fdncred fdncred commented Dec 13, 2021

this change allows all colors in the color_config section of the config.nu to have foreground, background, and color attributes. the foreground and background are written in hex colors like #rrggbb and the attributes are a concatenated string with the following values and meaning.

    for ch in color_attr.to_lowercase().chars() {
        match ch {
            'l' => blink = true,
            'b' => bold = true,
            'd' => dimmed = true,
            'h' => hidden = true,
            'i' => italic = true,
            'r' => reverse = true,
            's' => strikethrough = true,
            'u' => underline = true,
            'n' => (),
            _ => (),
        }
    }

the config.nu color_config section could look like this. comments are allowed, quotes around the hex colors and attributes are required.

  color_config: {
    separator: "#88b719" #yd
    leading_trailing_space_bg: white
    # header: cb
    header: {
      fg: "#B01455",
      bg: "#ffb900",
      attr: bli
    }
    date: "#75507B" #pu
    filesize: "#729fcf" #ub
    # row_index: yb
    row_index: {
      fg: "#e50914"
    }

so the bli in the header attr section means bold blink italic.
let the crazy colors begin. :)
crazy2

@kubouch
Copy link
Contributor

kubouch commented Dec 13, 2021

@fdncred Can you also update nushell/nushell#4300 with the new config?

@fdncred
Copy link
Contributor Author

fdncred commented Dec 13, 2021

@fdncred Can you also update nushell/nushell#4300 with the new config?

ya, once I land this I will. I'd like to get some input on the section I talked about above.

@fdncred fdncred marked this pull request as ready for review December 14, 2021 19:34
@fdncred fdncred merged commit a5c1dd0 into nushell:main Dec 14, 2021
@fdncred fdncred deleted the colors_with_fg_bg_attr branch December 14, 2021 19:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants