# `Delux.Program`
[🔗](https://github.com/elixir-circuits/delux/blob/v0.4.2/lib/delux/program.ex#L6)

Create LED patterns

See https://elixir.bootlin.com/linux/latest/source/Documentation/devicetree/bindings/leds/leds-trigger-pattern.txt

# `mode`

```elixir
@type mode() :: :one_shot | :simple_loop
```

Program playback mode

The playback mode determines what happens when the program gets interrupted
or ends.

* `:simple_loop` - keep repeating the program. If it's interrupted, just
  restart at the the beginning.
* `:one_shot` - run the program once

# `t`

```elixir
@type t() :: %Delux.Program{
  blue: Delux.Pattern.t(),
  description: IO.ANSI.ansidata(),
  green: Delux.Pattern.t(),
  mode: mode(),
  red: Delux.Pattern.t()
}
```

Program information for one indicator

# `adjust_brightness_pwm`

```elixir
@spec adjust_brightness_pwm(t(), 0..100) :: t()
```

Adjust the brightness of a pattern

This modifies the pattern to optionally dim it by blinking the LED at 50 Hz.
It is not an efficient way of dimming LEDs since the blinking is done on the processor by the kernel.

# `ansi_description`

```elixir
@spec ansi_description(t()) :: IO.ANSI.ansidata()
```

Return a description with nice ANSI colors

The description is returned as `IO.ANSI.ansidata()`. Use `IO.ANSI.format/1` to
expect escape codes for display with `IO.puts/1`.

# `simplify`

```elixir
@spec simplify(t()) :: t()
```

Reduce the number of transitions in a pattern

This reduces the length of the pattern and in some cases makes it
use less of the CPU to run. It's useful for programmatically
generated patterns that can take inputs that generate lots
of repeating sequences.

# `text_description`

```elixir
@spec text_description(t()) :: String.t()
```

Return an unformatted description of the pattern

See `ansi_description/1` for colorized description

---

*Consult [api-reference.md](api-reference.md) for complete listing*
