Change the color of console text.

Overview

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

Issues
  • 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.

    opened by jeffallen 2
  • 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

    opened by dixonwille 1
  • 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.

    opened by hillu 1
  • 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"...) } }

    opened by woodpenker 0
  • 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.

    opened by odhs 0
Releases(v0.18.0)
Owner
Yi Deng
Yi Deng
: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

MinJae Kwon 84 Jun 2, 2022
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

Makhnev Petr 42 Jun 23, 2022
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

Trey Tacon 396 Jun 15, 2022
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

Roi Martin 8.3k Jun 24, 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 | Pretty Terminal Printer A golang module to print pretty text Show Demo Code PTerm.sh | Installation | Documentation | Quick Start | Example

null 2.6k Jun 21, 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

Yi Deng 210 Mar 8, 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

null 37 Dec 15, 2021
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

Daniel Svitan 1 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. GO CLI 控制台颜色渲染工具库,支持16色,256色,RGB色彩渲染输出,使用类似于 Print/Sprintf,兼容并支持 Windows 环境的色彩渲染

Gookit 1.1k Jun 19, 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

null 3 Apr 9, 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

Hisam Fahri 4 May 20, 2022
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.

Naveen Mahalingam 1.3k Jun 20, 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

Peter Kleiweg 67 Feb 13, 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

Peter Kleiweg 67 Feb 13, 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 Chalk is a Go Package which can be used for making terminal output more vibrant with text colors, text styles and background colors. Documentati

null 4 Jun 21, 2022
null 0 Jan 27, 2022
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

null 0 Feb 9, 2022
Read the text of memes, then inject that text into the image as searchable metadata.

Make Meme Text Searchable I have an extensive set of memes I've been collecting since the early days of Flickr. #icanhascheeseburger It's a pain in th

Ryan Parman 2 May 2, 2022
A program to build, run, and restart a Go program on code change

devrun A program to build, run, and restart a Go program on code change. It also supports watching all your Go imports too. So if you change the code

Kevin Darlington 19 Apr 4, 2022
DockerSlim (docker-slim): Don't change anything in your Docker container image and minify it by up to 30x (and for compiled languages even more) making it secure too! (free and open source)

Minify and Secure Docker containers (free and open source!) Don't change anything in your Docker container image and minify it by up to 30x making it

docker-slim 13.8k Jun 28, 2022
Run a command when files change

Reflex Reflex is a small tool to watch a directory and rerun a command when certain files change. It's great for automatically running compile/lint/te

Caleb Spare 2.7k Jun 25, 2022
Open Source runtime tool which help to detect malware code execution and run time mis-configuration change on a kubernetes cluster

Kube-Knark Project Trace your kubernetes runtime !! Kube-Knark is an open source tracer uses pcap & ebpf technology to perform runtime tracing on a de

Chen Keinan 30 May 21, 2022
Run commands when files change.

Crow crow is a simple command-line utility that lets you run arbitrary commands when certain files change. Demo A demonstration of crow being used to

Maas Lalani 120 Jun 24, 2022
Knative Controller which emits cloud events when Knative Resources change state

Knative Sample Controller Knative sample-controller defines a few simple resources that are validated by webhook and managed by a controller to demons

salaboy 2 Oct 2, 2021
A CLI tool to change monitor settings over USB to the Gigabyte M32U

Gigabyte Monitor control Introduction A CLI tool to change monitor settings over USB to the Gigabyte M32U Supported monitors Gigabyte M32U In theory a

Kelvie Wong 8 May 3, 2022
A decentralized, cryptocurrency platform that can change this world!

Go Detonus Official Golang implementation of the Detonus protocol. Building the source For prerequisites and detailed build instructions please read t

Detonus (DT) 3 Oct 19, 2021