Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/n7st/go-ircformat
Golang IRC text formatting helpers
https://github.com/n7st/go-ircformat
color colours formatting go golang irc
Last synced: 9 days ago
JSON representation
Golang IRC text formatting helpers
- Host: GitHub
- URL: https://github.com/n7st/go-ircformat
- Owner: n7st
- Created: 2021-04-12T08:23:06.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-04-12T22:32:25.000Z (over 3 years ago)
- Last Synced: 2023-07-27T22:24:00.970Z (over 1 year ago)
- Topics: color, colours, formatting, go, golang, irc
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `go-ircformat`
This package contains IRC text formatting and coloring helpers.
## Installation
```
go get -u github.com/n7st/go-ircformat
```## Features
### Text coloring
There are specific helpers for foreground text colors:
```go
import ircColor "github.com/n7st/go-ircformat/color"func main() {
redText := ircColor.Red("some text")// ...
}
```There is a helper for applying both foreground and background coloring:
```go
import ircColor "github.com/n7st/go-ircformat/color"func main() {
redTextWhiteYellowBackground := ircColor.Color("my text", &ircColor.Colors{
Background: ircColor.New(ircColor.ColorYellow),
Foreground: ircColor.New(ircColor.ColorRed),
})// ...
}
```### Emphasis
There are helpers for bold, italic, underline, strikethrough and monospace:
```go
import ircEmphasis "github.com/n7st/go-ircformat/emphasis"func main() {
boldText := ircEmphasis.Bold("my text")italicText := ircEmphasis.Italic("my text")
underlineText := ircEmphasis.Underline("my text")
strikethroughText := ircEmphasis.Strikethrough("my text")
monospaceText := ircEmphasis.Monospace("my text")
// ...
}
```### Combining colors and emphasis
```go
import (
ircColor "github.com/n7st/go-ircformat/color"
ircEmphasis "github.com/n7st/go-ircformat/emphasis"
)func main() {
boldRedText := ircEmphasis.Bold(ircColor.Red("my text"))boldRedYellowText := ircEmphasis.Bold(ircColor.Color("my text", &ircColor.Colors{
Background: ircColor.New(ircColor.ColorYellow),
Foreground: ircColor.New(ircColor.ColorRed),
}))// ...
}
```