• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • CPACK
    • Home
    • List packs
    • Submit pack
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

A.2 library(ansi_term): Print decorated text to ANSI consoles
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
      • The SWI-Prolog library
        • library(ansi_term): Print decorated text to ANSI consoles
          • ansi_format/3
          • ansi_format/4
          • ansi_sgr/2
          • console_color/3
          • console_color/2
          • theme_base/2
          • message_line_element/2
          • ansi_hyperlink/2
          • ansi_hyperlink/3
          • tty_url_hook/2
          • ansi_get_color/2
    • Packages
Availability::- use_module(library(ansi_term)).(can be autoloaded)
Source[semidet]ansi_get_color(+Which, -RGB)
Obtain the RGB color for an ANSI color parameter. Which is either a color alias or an integer ANSI color id. Defined aliases are foreground and background. This predicate sends a request to the console (user_output) and reads the reply. This assumes an xterm compatible terminal.
RGB is a term rgb(Red,Green,Blue). The color components are floats in the range 0.0..1.0. They are sRGB encoded, as that is what the terminal reports; linearise them before doing colour arithmetic that assumes light intensities.
Compatibility
Up to version 10.1.13 the components were integers in the range 0..65535. The terminal reports one to four hexadecimal digits per component, so that range suggested a precision the reply does not have, and it clashed with the rgb/3 term of win_window_color/2, whose components are in the range 0..255.
ClioPatria (version V3.1.1-59-g7b9a7a3)