Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dahlia-lib/dahlia-gleam
Dahlia — a simple text formatting package, inspired by the game Minecraft.
https://github.com/dahlia-lib/dahlia-gleam
ansi cli color dahlia gleam terminal text-formatting
Last synced: about 2 months ago
JSON representation
Dahlia — a simple text formatting package, inspired by the game Minecraft.
- Host: GitHub
- URL: https://github.com/dahlia-lib/dahlia-gleam
- Owner: dahlia-lib
- License: wtfpl
- Created: 2023-03-05T11:22:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-04-03T22:40:38.000Z (over 1 year ago)
- Last Synced: 2024-04-20T08:00:32.260Z (5 months ago)
- Topics: ansi, cli, color, dahlia, gleam, terminal, text-formatting
- Language: Gleam
- Homepage:
- Size: 34.2 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Package Version](https://img.shields.io/hexpm/v/dahlia)](https://hex.pm/packages/dahlia)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/dahlia/)# Dahlia.gleam
A Gleam port of [Dahlia](https://github.com/dahlia-lib/Dahlia) — a simple text formatting package, inspired by the game Minecraft.
## Exmaple
```gleam
dahlia.new()
|> dahlia.print("&aHello World")
```## Installation
If available on Hex this package can be added to your Gleam project:
```sh
gleam add dahlia
```and its documentation can be found at .
# Color Codes
You can find a list of color codes on [the minecraft wiki](https://minecraft.fandom.com/wiki/Formatting_codes).
| Command | Description |
| ----------- | ----------- |
| `&n` | Change the color to `n` |
| `&~n` | Change the background color to `n` |
| `&[#HEXNUM]` | Change the color to `#HEXNUM` |
| `&~[#HEXNUM]` | Change the background color to `#HEXNUM` |
| `\\&` | Display an & |