term::ansi::code::attr(3tcl)

πŸ“¦
version 2.0 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

term::ansi::code::attr πŸ’…βœ¨

okay bestie, sit down, we're talking about the Tcllib page term::ansi::code::attr(3tcl) from the Terminal control manual section. this is the one that gives you cute little symbolic names for ANSI attribute codes so you never have to hand-type an escape sequence again. it's giving "I memorized the color codes so you don't have to" and honestly? iconic. πŸŽ€


🌸 NAME 🌸

term::ansi::code::attr β€” ANSI attribute sequences


✨ SYNOPSIS ✨

package require Tcl 8.5 9

package require term::ansi::code ?0.2?

package require term::ansi::code::attr ?0.2?

::term::ansi::code::attr::names

::term::ansi::code::attr::import ?ns? ?arg...?

::term::ansi::code::attr::fgblack

::term::ansi::code::attr::fgred

::term::ansi::code::attr::fggreen

::term::ansi::code::attr::fgyellow

::term::ansi::code::attr::fgblue

::term::ansi::code::attr::fgmagenta

::term::ansi::code::attr::fgcyan

::term::ansi::code::attr::fgwhite

::term::ansi::code::attr::fgdefault

::term::ansi::code::attr::bgblack

::term::ansi::code::attr::bgred

::term::ansi::code::attr::bggreen

::term::ansi::code::attr::bgyellow

::term::ansi::code::attr::bgblue

::term::ansi::code::attr::bgmagenta

::term::ansi::code::attr::bgcyan

::term::ansi::code::attr::bgwhite

::term::ansi::code::attr::bgdefault

::term::ansi::code::attr::bold

::term::ansi::code::attr::dim

::term::ansi::code::attr::italic

::term::ansi::code::attr::underline

::term::ansi::code::attr::blink

::term::ansi::code::attr::revers

::term::ansi::code::attr::hidden

::term::ansi::code::attr::strike

::term::ansi::code::attr::nobold

::term::ansi::code::attr::noitalic

::term::ansi::code::attr::nounderline

::term::ansi::code::attr::noblink

::term::ansi::code::attr::norevers

::term::ansi::code::attr::nohidden

::term::ansi::code::attr::nostrike

::term::ansi::code::attr::reset

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically this package hands you symbolic names for the ANSI attribute control codes. for every single control code there's one command, and that command just returns the code as its result. that's it. that's the whole job. πŸ’–

big important note, do not skip this: none of the commands in this package write to a channel. like, zero. not one. that part is handled by higher level packages, like term::ansi::send. so don't come for this package when nothing shows up on your terminal β€” it's not that kind of girl. 😭

πŸ‘‘ API πŸ‘‘

πŸ” INTROSPECTION πŸ”

  • ::term::ansi::code::attr::names β€” this one is purely for introspection, bestie. it returns a list containing the names of all the attribute commands. use it when you wanna know what you're working with. 🫢
  • ::term::ansi::code::attr::import ?ns? ?arg...? β€” this command imports some or all of the attribute commands into the namespace ns. by default that namespace is attr. heads up though: it's a relative namespace name, so it drops the imported commands into a child of the current namespace. by default all commands get imported, but you can restrict that by listing the names of the wanted commands after the namespace argument. (yes, the original says "howver". we love a typo era. πŸ’€)

🎨 ATTRIBUTES 🎨

  • ::term::ansi::code::attr::fgblack β€” set text color to Black.
  • ::term::ansi::code::attr::fgred β€” set text color to Red.
  • ::term::ansi::code::attr::fggreen β€” set text color to Green.
  • ::term::ansi::code::attr::fgyellow β€” set text color to Yellow.
  • ::term::ansi::code::attr::fgblue β€” set text color to Blue.
  • ::term::ansi::code::attr::fgmagenta β€” set text color to Magenta.
  • ::term::ansi::code::attr::fgcyan β€” set text color to Cyan.
  • ::term::ansi::code::attr::fgwhite β€” set text color to White.
  • ::term::ansi::code::attr::fgdefault β€” set default text color (Black).
  • ::term::ansi::code::attr::bgblack β€” set background to Black.
  • ::term::ansi::code::attr::bgred β€” set background to Red.
  • ::term::ansi::code::attr::bggreen β€” set background to Green.
  • ::term::ansi::code::attr::bgyellow β€” set background to Yellow.
  • ::term::ansi::code::attr::bgblue β€” set background to Blue.
  • ::term::ansi::code::attr::bgmagenta β€” set background to Magenta.
  • ::term::ansi::code::attr::bgcyan β€” set background to Cyan.
  • ::term::ansi::code::attr::bgwhite β€” set background to White.
  • ::term::ansi::code::attr::bgdefault β€” set default background (Transparent).
  • ::term::ansi::code::attr::bold β€” Bold on.
  • ::term::ansi::code::attr::dim β€” Dim on.
  • ::term::ansi::code::attr::italic β€” Italics on.
  • ::term::ansi::code::attr::underline β€” Underscore on.
  • ::term::ansi::code::attr::blink β€” Blink on.
  • ::term::ansi::code::attr::revers β€” Reverse on.
  • ::term::ansi::code::attr::hidden β€” Hidden on.
  • ::term::ansi::code::attr::strike β€” Strike-through on.
  • ::term::ansi::code::attr::nobold β€” Bold off.
  • ::term::ansi::code::attr::noitalic β€” Italics off.
  • ::term::ansi::code::attr::nounderline β€” Underscore off.
  • ::term::ansi::code::attr::noblink β€” Blink off.
  • ::term::ansi::code::attr::norevers β€” Reverse off.
  • ::term::ansi::code::attr::nohidden β€” Hidden off.
  • ::term::ansi::code::attr::nostrike β€” Strike-through off.
  • ::term::ansi::code::attr::reset β€” Reset all attributes to their default values.

πŸ’€ BUGS, IDEAS, FEEDBACK πŸ’€

ngl bestie, this document and the package it describes will undoubtedly contain bugs and other problems. like, that's just how it is. please report such in the category term of the Tcllib Trackers at http://core.tcl.tk/tcllib/reportlist. and please also report any ideas for enhancements you may have for either the package and/or the documentation. we love a glow-up suggestion. ✨

when proposing code changes, please provide unified diffs, i.e the output of diff -u.

note further that attachments are strongly preferred over inlined patches. attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. (iykyk 🫢)


πŸŽ€ KEYWORDS πŸŽ€

ansi, attribute control, color control, control, terminal


🌈 CATEGORY 🌈

Terminal control


Copyright (c) 2006 Andreas Kupries <andreas_kupries@users.sourceforge.net>


okay and that's the whole page, bestie!! this came to you from tcllib, version 0.2, and the page is term::ansi::code::attr(3tcl) β€” go color your terminal, you main character πŸ’…πŸŒΈπŸ¦‹ periodt.

πŸ“¦ where this page comes from