The official Odin rewrite of the Rust Farben terminal coloring library.
Install Odyn, the reproducible vendoring tool, here.
Add it to your project:
odyn get razkar/ofarben --platform codeberg
# OR
odyn get razkar-studio/farbenImport in your Odin code:
import frb "deps:ofarben"Clone the repository and add it to your project:
git clone https://codeberg.org/razkar/ofarbenThen import it in your Odin code:
import frb "path/to/ofarben"import frb "ofarben"
main :: proc() {
frb.cprintfln("[bold red]Error:[/] something went wrong.")
frb.cprintfln("[green]Success:[/] operation completed.")
frb.cprintfln("[bg:blue white]Highlighted text[/]")
}Colors are automatically disabled when NO_COLOR is set or the output is not a TTY.
| Tag | Description |
|---|---|
[red] |
Named foreground color |
[bg:red] |
Named background color |
[fg:red] |
Explicit foreground (same as [red]) |
[rgb(255,0,0)] |
RGB foreground color |
[bg:rgb(255,0,0)] |
RGB background color |
[ansi(196)] |
ANSI 256 foreground color |
[bg:ansi(196)] |
ANSI 256 background color |
[#ff0000] |
Hex foreground color |
[bg:#ff0000] |
Hex background color |
[#f00] |
Shorthand hex foreground |
Available named colors: black, red, green, yellow, blue, magenta, cyan, white, and their bright- variants (e.g. bright-red).
| Tag | Description |
|---|---|
[bold] |
Bold |
[dim] |
Dim |
[italic] |
Italic |
[underline] |
Underline |
[double_underline] |
Double underline |
[strikethrough] |
Strikethrough |
[blink] |
Blink |
[rapid_blink] |
Rapid blink |
[overline] |
Overline |
[invisible] |
Invisible |
[reverse] |
Reverse |
| Tag | Description |
|---|---|
[/] |
Reset all styles |
[/red] |
Reset specific color |
[/bold] |
Reset specific emphasis |
| Sequence | Output |
|---|---|
[[ |
Literal [ |
]] |
Literal ] |
Multiple tags can be combined in one bracket:
[bold red bg:blue]text[/]
All procedures accept a reset parameter (default true) that controls whether styles are reset after the call. Set reset = false to bleed styles into the next call.
Click to expand
| Procedure | Description |
|---|---|
cprintf(markup, args, flush, reset) |
Print without newline |
cprintfln(markup, args, flush, reset) |
Print with newline |
cprint(args, sep, flush, reset) |
Print args without newline |
cprintln(args, sep, flush, reset) |
Print args with newline |
| Procedure | Description |
|---|---|
ceprintf(markup, args, flush, reset) |
Print to stderr without newline |
ceprintfln(markup, args, flush, reset) |
Print to stderr with newline |
ceprint(args, sep, flush, reset) |
Print args to stderr without newline |
ceprintln(args, sep, flush, reset) |
Print args to stderr with newline |
| Procedure | Description |
|---|---|
ctprintf(markup, args, reset) |
Styled string without newline |
ctprintfln(markup, args, reset) |
Styled string with newline |
ctprint(args, sep, reset) |
Styled args without newline |
ctprintln(args, sep, reset) |
Styled args with newline |
| Procedure | Description |
|---|---|
caprintf(markup, args, reset, allocator) |
Styled string without newline |
caprintfln(markup, args, reset, allocator) |
Styled string with newline |
caprint(args, sep, reset, allocator) |
Styled args without newline |
caprintln(args, sep, reset, allocator) |
Styled args with newline |
| Procedure | Description |
|---|---|
cbprintf(buf, markup, args, reset) |
Write styled string to byte buffer |
cbprintfln(buf, markup, args, reset) |
Write styled string to byte buffer with newline |
cbprint(buf, args, sep, reset) |
Write styled args to byte buffer |
cbprintln(buf, args, sep, reset) |
Write styled args to byte buffer with newline |
| Procedure | Description |
|---|---|
csbprintf(buf, markup, args, reset) |
Write styled string to Builder |
csbprintfln(buf, markup, args, reset) |
Write styled string to Builder with newline |
csbprint(buf, args, sep, reset) |
Write styled args to Builder |
csbprintln(buf, args, sep, reset) |
Write styled args to Builder with newline |
| Procedure | Description |
|---|---|
cwprintf(w, markup, args, flush, reset) |
Write styled string to io.Writer |
cwprintfln(w, markup, args, flush, reset) |
Write styled string to io.Writer with newline |
cwprint(w, args, sep, flush, reset) |
Write styled args to io.Writer |
cwprintln(w, args, sep, flush, reset) |
Write styled args to io.Writer with newline |
| Procedure | Description |
|---|---|
csprintf(markup, args, reset) |
Same as ctprintf |
csprintfln(markup, args, reset) |
Same as ctprintfln |
csprint(args, sep, reset) |
Same as ctprint |
csprintln(args, sep, reset) |
Same as ctprintln |
| Procedure | Description |
|---|---|
unmarkup(src, allocator) |
Strip all markup tags, return plain text |
unansi(src, allocator) |
Strip ANSI escape codes |
untag(src, allocator) |
Escape markup for safe display through the pipeline |
This project is licensed under the zlib license.
Cheers, RazkarStudio.
Copyright © 2026 RazkarStudio. All rights reserved.

