Change the color of console text.

go-colortext package GoSearch

This is a package to change the color of the text and background in the console, working both under Windows and other systems.

Under Windows, the console APIs are used. Otherwise, ANSI texts are output.

Docs: http://godoc.org/github.com/daviddengcn/go-colortext (packages that import ct)

Usage:

ct.Foreground(Green, false)
fmt.Println("Green text starts here...")
ct.ChangeColor(Red, true, White, false)
fmt.Println(...)
ct.ResetColor()

LICENSE

BSD/MIT license

Comments
  • Tag 1.0.0 please

    Tag 1.0.0 please

    Hello, I am using dep to lock versions and it would be helpful if you could do "git tag 1.0.0; git push --tags" in order to make a tagged release.

  • Usage of your package in mine

    Usage of your package in mine

    I have a package that I feel is quite useful. I am using the MIT License and added a link to this repo in the Readme (before reading your license sorry). I would like to continue using this package as it is a great tool to use for cross platform applications (I couldn't find another color tool that was as simple as this and cross platform). If there are any concerns or problems with this please contact me.

    Thanks, Will Dixon

  • Please pick a license

    Please pick a license

    I have been using go-colortext in a project at work because it works well on Unix and Windows and just noticed that there is no license which means that technically we can't be sure whether we are allowed to use it.

    Please pick and add a license. Thank you.

  • Is it a mistake of func ansiText in ct_ansi.go?

    Is it a mistake of func ansiText in ct_ansi.go?

    I find that the parameter bgBright(bool) isn't being used in func ansiText.Did you miss it? why not change: if bg != None { s = strconv.AppendUint(append(s, ";"...), 40+(uint64)(bg-Black), 10) } to : if bg != None { s = strconv.AppendUint(append(s, ";"...), 40+(uint64)(bg-Black), 10) if bgBright { s = append(s, ";1"...) } }

  • Changes in the documentation

    Changes in the documentation

    In the examples of usage in README.md:

    ct.Foreground(Green, false)
    ct.ChangeColor(Red, true, White, false)
    

    BUT, it is working with "ct.":

    ct.Foreground(ct.Green,ct. false)
    ct.ChangeColor(ct.Red, true, ct.White, false)
    

    Thank you and Congratulations! It works very well in both systems, linux and windows.

:art: Contextual fmt inspired by bootstrap color classes

Cfmt Contextual fmt It provides contextual formatting functions that have nearly identical usage of the fmt package. The ideas were borrowed from boot

Jan 7, 2023
Small library for simple and convenient formatted stylized output to the console.
Small library for simple and convenient formatted stylized output to the console.

cfmt cfmt is a small library for simple and convenient formatted stylized output to the console, providing an interface that is exactly the same as th

Jan 7, 2023
Intuitive package for prettifying terminal/console output. http://godoc.org/github.com/ttacon/chalk
Intuitive package for prettifying terminal/console output. http://godoc.org/github.com/ttacon/chalk

chalk Chalk is a go package for styling console/terminal output. Check out godoc for some example usage: http://godoc.org/github.com/ttacon/chalk The

Dec 23, 2022
Minimalist Go package aimed at creating Console User Interfaces.
Minimalist Go package aimed at creating Console User Interfaces.

GOCUI - Go Console User Interface Minimalist Go package aimed at creating Console User Interfaces. Features Minimalist API. Views (the "windows" in th

Dec 25, 2022
✨ #PTerm is a modern go module to beautify console output. Featuring charts, progressbars, tables, trees, and many more 🚀 It's completely configurable and 100% cross-platform compatible.
✨ #PTerm is a modern go module to beautify console output. Featuring charts, progressbars, tables, trees, and many more 🚀 It's completely configurable and 100% cross-platform compatible.

?? PTerm | Pretty Terminal Printer A golang module to print pretty text Show Demo Code PTerm.sh | Installation | Documentation | Quick Start | Example

Dec 27, 2022
Change the color of console text.

go-colortext package This is a package to change the color of the text and background in the console, working both under Windows and other systems. Un

Oct 26, 2022
Console Text Colors - The non-invasive cross-platform terminal color library does not need to modify the Print method

ctc - Console Text Colors The non-invasive cross-platform terminal color library does not need to modify the Print method Virtual unix-like environmen

Nov 9, 2022
Ipctl - Listen to IP change and change your DNS' records dynamically

ipctl Listen to IP change and change your DNS' records dynamically Table of cont

Feb 17, 2022
🎨 Terminal color rendering library, support 8/16 colors, 256 colors, RGB color rendering output, support Print/Sprintf methods, compatible with Windows.
🎨 Terminal color rendering library, support 8/16 colors, 256 colors, RGB color rendering output, support Print/Sprintf methods, compatible with Windows.

?? Terminal color rendering library, support 8/16 colors, 256 colors, RGB color rendering output, support Print/Sprintf methods, compatible with Windows. GO CLI 控制台颜色渲染工具库,支持16色,256色,RGB色彩渲染输出,使用类似于 Print/Sprintf,兼容并支持 Windows 环境的色彩渲染

Dec 30, 2022
A Go package for converting RGB and other color formats/colorspaces into DMC thread colors (DMC color name and floss number)

go-c2dmc A Go package for converting RGB and other color formats/colorspaces into DMC thread colors (DMC color name and floss number). Implemented as

Jul 25, 2022
COCO (Color Converter) is a color conversion library for Go.

COCO (Color Converter) for Go COCO (Color Converter) is a color conversion library for Go. Heavily inspired by NPM's color-convert. It converts all wa

Oct 4, 2022
Utilities to prettify console output of tables, lists, progress-bars, text, etc.
Utilities to prettify console output of tables, lists, progress-bars, text, etc.

go-pretty Utilities to prettify console output of tables, lists, progress-bars, text, etc. Table Pretty-print tables into ASCII/Unicode strings.

Dec 29, 2022
Console based text-adventure RPG
Console based text-adventure RPG

Download: Windows, MacOS, Linux Demo: Video Console Quest Welcome to Console Quest! In this text-based adventure game, you'll embark on a journey to e

Apr 30, 2023
A Go package for n-gram based text categorization, with support for utf-8 and raw text

A Go package for n-gram based text categorization, with support for utf-8 and raw text. To do: write documentation make it faster Keywords: text categ

Nov 28, 2022
A Go package for n-gram based text categorization, with support for utf-8 and raw text

A Go package for n-gram based text categorization, with support for utf-8 and raw text. To do: write documentation make it faster Keywords: text categ

Nov 28, 2022
Chalk is a Go Package which can be used for making terminal output more vibrant with text colors, text styles and background colors.
Chalk is a Go Package which can be used for making terminal output more vibrant with text colors, text styles and background colors.

Chalk Chalk is a Go Package which can be used for making terminal output more vibrant with text colors, text styles and background colors. Documentati

Oct 29, 2022
Jan 27, 2022
Generates random text based on trigrams generated from input text
Generates random text based on trigrams generated from input text

Trigrams Generates random text based on trigrams generated from input text Contents Building Running Using Implementation notes NGram size Maximum wor

Feb 9, 2022