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

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.

    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
Owner
Yi Deng
Yi Deng
A general purpose application and library for aligning text.

align A general purpose application that aligns text The focus of this application is to provide a fast, efficient, and useful tool for aligning text.

John Moore 77 Sep 2, 2022
Parse placeholder and wildcard text commands

allot allot is a small Golang library to match and parse commands with pre-defined strings. For example use allot to define a list of commands your CL

Sebastian Müller 56 Sep 27, 2022
Guess the natural language of a text in Go

guesslanguage This is a Go version of python guess-language. guesslanguage provides a simple way to detect the natural language of unicode string and

Nikita Vershinin 56 Sep 27, 2022
omniparser: a native Golang ETL streaming parser and transform library for CSV, JSON, XML, EDI, text, etc.

omniparser Omniparser is a native Golang ETL parser that ingests input data of various formats (CSV, txt, fixed length/width, XML, EDI/X12/EDIFACT, JS

JF Technology 494 Sep 27, 2022
Produces a set of tags from given source. Source can be either an HTML page, Markdown document or a plain text. Supports English, Russian, Chinese, Hindi, Spanish, Arabic, Japanese, German, Hebrew, French and Korean languages.

Tagify Gets STDIN, file or HTTP address as an input and returns a list of most popular words ordered by popularity as an output. More info about what

ZoomIO 23 Aug 22, 2022
Extract urls from text

xurls Extract urls from text using regular expressions. Requires Go 1.13 or later. import "mvdan.cc/xurls/v2" func main() { rxRelaxed := xurls.Relax

Daniel Martí 962 Sep 24, 2022
Easy AWK-style text processing in Go

awk Description awk is a package for the Go programming language that provides an AWK-style text processing capability. The package facilitates splitt

Scott Pakin 94 Jul 25, 2022
Templating system for HTML and other text documents - go implementation

FAQ What is Kasia.go? Kasia.go is a Go implementation of the Kasia templating system. Kasia is primarily designed for HTML, but you can use it for any

Michał Derkacz 74 Mar 15, 2022
Package sanitize provides functions for sanitizing text in golang strings.

sanitize Package sanitize provides functions to sanitize html and paths with go (golang). FUNCTIONS sanitize.Accents(s string) string Accents replaces

Kenny Grant 320 Sep 13, 2022
Small and fast FTS (full text search)

Microfts A small full text indexing and search tool focusing on speed and space. Initial tests seem to indicate that the database takes about twice as

Bill Burdick 27 Jul 30, 2022
text to speech bot for discord

text to speech bot for discord

takanakahiko 20 Jul 1, 2022
A diff3 text merge implementation in Go

Diff3 A diff3 text merge implementation in Go based on the awesome paper below. "A Formal Investigation of Diff3" by Sanjeev Khanna, Keshav Kunal, and

Keenan Nemetz 20 Sep 5, 2022
gomtch - find text even if it doesn't want to be found

gomtch - find text even if it doesn't want to be found Do your users have clever ways to hide some terms from you? Sometimes it is hard to find forbid

Nicolas Augusto Sassi 28 Sep 28, 2022
Unified text diffing in Go (copy of the internal diffing packages the officlal Go language server uses)

gotextdiff - unified text diffing in Go This is a copy of the Go text diffing packages that the official Go language server gopls uses internally to g

Hexops 89 Sep 8, 2022
Convert scanned image PDF file to text annotated PDF file

Jisui (自炊) This tool is PoC (Proof of Concept). Jisui is a helper tool to create e-book. Ordinary the scanned book have not text information, so you c

Takumasa Sakao 27 Apr 7, 2022
A modern text indexing library for go

bleve modern text indexing in go - blevesearch.com Features Index any go data structure (including JSON) Intelligent defaults backed up by powerful co

bleve 8.6k Sep 28, 2022
Paranoid text spacing in Go (Golang)

pangu.go Paranoid text spacing for good readability, to automatically insert whitespace between CJK (Chinese, Japanese, Korean) and half-width charact

Vinta Chen 84 Sep 27, 2022
Diff, match and patch text in Go

go-diff go-diff offers algorithms to perform operations required for synchronizing plain text: Compare two texts and return their differences. Perform

Sergi Mansilla 1.4k Sep 21, 2022
:book: A Golang library for text processing, including tokenization, part-of-speech tagging, and named-entity extraction.

prose prose is a natural language processing library (English only, at the moment) in pure Go. It supports tokenization, segmentation, part-of-speech

Joseph Kato 2.9k Sep 22, 2022