term::ansi::code::attr(n)

πŸ“¦
version 2.0 Β· 2 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

✨ term::ansi::code::attr β€” the ANSI attribute glow-up ✨

okay bestie, welcome to term::ansi::code::attr, a lil Tcllib package (manual name term::ansi::code::attr(n), filed under Terminal control) that hands you cute symbolic names for all the ANSI attribute control codes. no cap, that's the whole job. πŸŽ€


πŸ’– NAME πŸ’–

term::ansi::code::attr β€” ANSI attribute sequences. that's it, that's the name, iconic.


🌸 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 this package is literally just a vibe dictionary for ANSI attribute control codes. for every single control code there's one command, and that command returns the code as its result. done. that's the tea. ✨

big important note, bestie: none of these commands write to a channel. not one. that whole "actually putting the codes on the screen" situation is handled by higher level packages, like term::ansi::send. this package is just the lookup table, the backstage crew, the main-character-adjacent supporting cast. 🫢

πŸ‘‘ API πŸ‘‘

πŸ” INTROSPECTION πŸ”

  • ::term::ansi::code::attr::names β€” this one is for introspection, iykyk. it returns a list containing the names of all the attribute commands. your full menu, no substitutions.
  • ::term::ansi::code::attr::import ?ns? ?arg...? β€” this one imports some or all of the attribute commands into the namespace ns. by default ns is the namespace attr. heads up though: it's a relative namespace name, so the imported command lands in a child of the current namespace, not some absolute place. and by default all the commands get imported β€” you can restrict that by listing the names of the wanted commands after the namespace argument. picky eaters welcome. πŸ’…

🌈 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. the big undo button, the factory reset, the "we don't talk about that anymore". πŸ’€

😭 BUGS, IDEAS, FEEDBACK 😭

ngl, this document β€” and the package it describes β€” will undoubtedly contain bugs and other problems. that's just how it is, we're all doing our best out here. πŸ™ˆ 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 want the ideas, we love the ideas. πŸ’œ

when proposing code changes, please provide unified diffs, i.e the output of diff -u. no vibes-based diffs, bestie, we need the real thing.

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. screenshot the buttons, follow the path, slay. πŸ”₯


⭐ KEYWORDS ⭐

ansi, attribute control, color control, control, terminal


πŸŽ€ CATEGORY πŸŽ€

Terminal control


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


and that's the whole page, bestie β€” brought to you by tcllib, version 0.2, living under Terminal control, and yes the copyright has been 2006 Andreas Kupries the whole time. periodt. πŸ’–βœ¨

πŸ“¦ where this page comes from