doc.odin 957 B

1234567891011121314151617181920
  1. /*
  2. package ansi implements constant references to many widely-supported ANSI
  3. escape codes, primarily used in terminal emulators for enhanced graphics, such
  4. as colors, text styling, and animated displays.
  5. For example, you can print out a line of cyan text like this:
  6. fmt.println(ansi.CSI + ansi.FG_CYAN + ansi.SGR + "Hellope!" + ansi.CSI + ansi.RESET + ansi.SGR)
  7. Multiple SGR (Select Graphic Rendition) codes can be joined by semicolons:
  8. fmt.println(ansi.CSI + ansi.BOLD + ";" + ansi.FG_BLUE + ansi.SGR + "Hellope!" + ansi.CSI + ansi.RESET + ansi.SGR)
  9. If your terminal supports 24-bit true color mode, you can also do this:
  10. fmt.println(ansi.CSI + ansi.FG_COLOR_24_BIT + ";0;255;255" + ansi.SGR + "Hellope!" + ansi.CSI + ansi.RESET + ansi.SGR)
  11. For more information, see:
  12. 1. https://en.wikipedia.org/wiki/ANSI_escape_code
  13. 2. https://www.vt100.net/docs/vt102-ug/chapter5.html
  14. 3. https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
  15. */
  16. package ansi