FUNCTION::ANSI_SET_COLOR(3stap)

πŸ’… NAME

function::ansi_set_color β€” sets the ansi Select Graphic Rendition mode, bestie. that's the whole vibe.

this lil guy lives in the SystemTap Tapset Reference, section 3stap, under the "Utility functions for using ansi" umbrella πŸŽ€


✨ SYNOPSIS ✨

three whole flavors, pick ur fighter:

1) ansi_set_color(fg:long)

2) ansi_set_color(fg:long,bg:long)

3) ansi_set_color(fg:long,bg:long,attr:long)

🎨 ARGUMENTS 🎨

  • fg β€” the foreground color you wanna set. the main character, literally.
  • bg β€” the background color you wanna set. the supporting cast 🫢
  • attr β€” the color attribute you wanna set. the lil je ne sais quoi ✨

🌈 DESCRIPTION 🌈

okay so there's three modes and they're all just sending ansi codes for Select Graphic Rendition, no cap:

  1. sends the ansi code for Select Graphic Rendition mode for the given foreground color. the lineup is: Black (30), Blue (34), Green (32), Cyan (36), Red (31), Purple (35), Brown (33), Light Gray (37). that's it, that's the palette πŸ’–
  2. sends the ansi code for Select Graphic Rendition mode for the given foreground color β€” Black (30), Blue (34), Green (32), Cyan (36), Red (31), Purple (35), Brown (33), Light Gray (37) β€” and the given background color, which is: Black (40), Red (41), Green (42), Yellow (43), Blue (44), Magenta (45), Cyan (46), White (47). double the color, double the slay πŸ’…
  3. sends the ansi code for Select Graphic Rendition mode for the given foreground color β€” Black (30), Blue (34), Green (32), Cyan (36), Red (31), Purple (35), Brown (33), Light Gray (37) β€” the given background color β€” Black (40), Red (41), Green (42), Yellow (43), Blue (44), Magenta (45), Cyan (46), White (47) β€” and the color attribute. the attributes on deck are: All attributes off (0), Intensity Bold (1), Underline Single (4), Blink Slow (5), Blink Rapid (6), Image Negative (7). full glow-up mode fr fr πŸ”₯

πŸ‘€ SEE ALSO πŸ‘€

tapset::ansi(3stap) β€” go read that one next, iykyk πŸ¦‹


and that's the whole page, babes πŸ’œ this was the SystemTap Tapset Reference, Version 3stap vibes, dated September 2026 β€” periodt, go make ur terminal pretty πŸŽ€βœ¨

πŸ“¦ where this page comes from