term::ansi::code::attr(n)
β¨ 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 namespaceattr. 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 π
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
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- Copyright (c) 2006 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms