Documentation

TermColor.Ansi

TermColor.Ansi: pure ANSI SGR encoding #

This module has no terminal detection and performs no IO. A RenderTarget makes the fallback policy explicit, so the same styled value can be rendered as plain text, ANSI-16, ANSI-256, or true color, with optional OSC-8 hyperlinks.

Whether styles are emitted, and how much color precision is available.

  • styles : Bool

    Whether SGR styles are emitted.

  • colors : ColorLevel

    Maximum color precision available to the renderer.

Instances For
    Equations
    Instances For
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          A plain-text target with no styles or colors.

          Equations
          Instances For

            The SGR layer to which a color is applied.

            • foreground : Layer

              The foreground SGR layer.

            • background : Layer

              The background SGR layer.

            Instances For
              Equations
              Instances For
                @[instance_reducible]
                Equations
                Equations
                Instances For

                  The SGR parameter string for a style at a target capability.

                  Equations
                  Instances For
                    def TermColor.Style.sgr (target : RenderTarget) (style : Style) :

                    Encode a style as an SGR opening sequence.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      Reset all SGR attributes and colors.

                      Equations
                      Instances For
                        def TermColor.Style.wrap (target : RenderTarget) (style : Style) (text : String) :

                        Wrap plain text in an opening SGR sequence and a complete reset.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For