aboutsummaryrefslogtreecommitdiff
path: root/aoc2023/build/packages/gleam_community_colour/README.md
blob: 0eccdd7dd50d2f2cade1ca0e537664ec931e40f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# gleam-community/colour

A package for a standard Colour type, conversions, and other utilities.

[![Package Version](https://img.shields.io/hexpm/v/gleam_community_colour)](https://hex.pm/packages/gleam_community_colour)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/gleam_community_colour/)

✨ This project is written in pure Gleam so you can use it anywhere Gleam runs: Erlang, Elixir, Node, Deno, and the browser!

---

## Quickstart

```gleam
import gleam_community/colour
import gleam_community/colour/accessibility

pub fn main() {
  let foreground = colour.from_hsl(h: 0.858, s: 1.0, l: 0.843)

  let background_options = [colour.light_grey, colour.dark_grey]

  let background = accessibility.maximum_contrast(foreground, background_options)
}
```

## Installation

`gleam_community` packages are published to [hex.pm](https://hex.pm/packages/gleam_community_colour)
with the prefix `gleam_community_`. You can add them to your Gleam projects directly:

```sh
gleam add gleam_community_colour
```

The docs can be found over at [hexdocs.pm](https://hexdocs.pm/gleam_community_colour).