Thanks to visit codestin.com
Credit goes to github.com

Skip to content

0xf0xx0/oigiki

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oigiki

Go Reference

fast ansi color tagging lib, inspired by blessed from node
extracted from axefetch and improved
minimum go version: 1.10

features

  • NO_COLOR support
  • all 16 colors (normal + bright)
  • 256color (as index, 0-255)
  • truecolor (as rrrggbb hex)

usage

/// coloring will run until overridden
/// chaining works too uwu
oigiki.ProcessTags("{red}red{green}green{/green}red") /// "\x1b[31mred\x1b[32mgreen\x1b[31mred\x1b[0m"
/// unknown tags are ignored
oigiki.ProcessTags("{red}red {totallyrealcolor}still red") /// "\x1b[31mred {totallyrealcolor}still red\x1b[0m"

oigiki.TagString("this should be red", "red") /// "{red}this should be red"
oigiki.StripTags("{red}{bold}whos that {bg#f100f1}{underline}knockin{/underline} at my door?") /// whos that knockin at my door?

256color

"{bg0}{7}yin{bg7}{0}yang"

truecolor

/// hex must be the full rrggbb
"{#ff00ff}ff00ff"
/// bg is easy too
"{bg#ff00ff}{black}ff00ff"

About

fast ansi color tagging lib, inspired by blessed from node

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages