diff --git a/src/ansi/colors.go b/src/ansi/colors.go index 6a30b966..7dfac222 100644 --- a/src/ansi/colors.go +++ b/src/ansi/colors.go @@ -124,7 +124,7 @@ func (d *DefaultColors) ToColor(colorString string, isBackground bool) Color { return emptyColor } c256 := color.C256(uint8(val), isBackground) - return Color(c256.RGBColor().String()) + return Color(c256.String()) } style := color.HEX(colorString, isBackground) if !style.IsEmpty() { diff --git a/src/ansi/colors_test.go b/src/ansi/colors_test.go index 0b0847a4..018d08eb 100644 --- a/src/ansi/colors_test.go +++ b/src/ansi/colors_test.go @@ -13,8 +13,8 @@ func TestGetAnsiFromColorString(t *testing.T) { Color string Background bool }{ - {Case: "256 color", Expected: Color("38;2;135;95;255"), Color: "99", Background: false}, - {Case: "256 color", Expected: Color("38;2;135;255;215"), Color: "122", Background: false}, + {Case: "256 color", Expected: Color("38;5;99"), Color: "99", Background: false}, + {Case: "256 color", Expected: Color("38;5;122"), Color: "122", Background: false}, {Case: "Invalid background", Expected: emptyColor, Color: "invalid", Background: true}, {Case: "Invalid background", Expected: emptyColor, Color: "invalid", Background: false}, {Case: "Hex foreground", Expected: Color("38;2;170;187;204"), Color: "#AABBCC", Background: false}, diff --git a/website/docs/configuration/colors.mdx b/website/docs/configuration/colors.mdx index 1c8a45b4..2d70e16d 100644 --- a/website/docs/configuration/colors.mdx +++ b/website/docs/configuration/colors.mdx @@ -8,7 +8,7 @@ sidebar_label: Colors Oh My Posh supports multiple different color references, being: -- Typical [hex colors][hexcolors] (for example `#CB4B16`). +- True color using [hex colors][hexcolors] (for example `#CB4B16`). - 16 [ANSI color names][ansicolors]. These include 8 basic ANSI colors and `default` diff --git a/website/docs/installation/macos.mdx b/website/docs/installation/macos.mdx index 243b062c..9745347f 100644 --- a/website/docs/installation/macos.mdx +++ b/website/docs/installation/macos.mdx @@ -11,7 +11,7 @@ import Next from "./next.mdx"; ## Set up your terminal -As the standard terminal has issues displaying the ANSI characters correctly, we advise using +As the standard terminal only support [256 colors][256-colors], we advise using [iTerm2][iterm2] or any other modern day macOS terminal that supports ANSI characters. :::info @@ -24,6 +24,7 @@ To display all icons, we recommend the use of a [Nerd Font][fonts]. +[256-colors]: /docs/configuration/colors#standard-colors [fonts]: /docs/installation/fonts [scoop]: https://scoop.sh/ [wt]: https://github.com/microsoft/terminal