Top 2.9% forks on proxy.golang.org
proxy.golang.org : github.com/ttacon/Chalk
Package chalk is a package for styling terminal/console output. There are three main components: There are eight default colors: black, red, green, yellow, blue, magenta, cyan and white. You can use them in two main ways (note the need for the reset color if you don't use Color()): There are seven default text styles: bold, dim, italic, underline, inverse, hidden and strikethrough. Unlike colors, you should only really use TextStyles in the following manner: Styles are where all the business really is. Styles can have a foreground color, a background color and a text style (sweet!). They're also pretty simply to make, you just need a starting point: When a color is your starting point for a style, it will be the foreground color, when a style is your starting point, well, yeah, it's your style's text style. You can also alter a style's foreground, background or text style in a builder-esque pattern. Like both Colors and TextStyles you can style specific segments of text with: Like Colors, you can also print styles explicitly, but you'll need to reset your console's colors with chalk.Reset if you use them this way: Be aware though, that this (second) way of using styles will not add the text style (as text styles require more specific end codes). So if you want to fully utilize styles, use myStyle.Style() (unless you only care about print your text with a specific foreground and background, then printing the style is awesome too!). Have fun!
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/ttacon/%21chalk
License: MIT
Latest release: almost 9 years ago
First release: almost 9 years ago
Namespace: github.com/ttacon
Stars: 422 on GitHub
Forks: 19 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: about 2 months ago