# `Alaja.Components.Pulsar`
[🔗](https://github.com/Lorenzo-SF/alaja/blob/2.1.0/lib/alaja/components/pulsar.ex#L1)

Pulsar/radar animation component with gradient wave effect.

Renders a rectangular area with content (text or image) in the center,
surrounded by characters that animate with a pulse/radar wave effect.

Uses the Cell/Buffer engine for proper rendering.

## Options

- `:width` — total width in characters (default: 40)
- `:height` — total height in lines (default: 7)
- `:text` — central text to display
- `:content_type` — `:text` or `:image` (default: `:text`)
- `:content_position_x` — X offset for content within pulsar (default: center)
- `:content_position_y` — Y offset for content within pulsar (default: center)
- `:pulse_chars` — characters used for pulse effect (default: ["░", "▒", "▓", "█"])
- `:colors` — list of RGB tuples for gradient (default: [{0, 180, 216}])
- `:speed` — animation speed in ms (default: 100)
- `:direction` — `:out` or `:in` wave direction (default: :out)
- `:align` — text alignment (:left, :center, :right; default: :center)

# `default_opts`

```elixir
@spec default_opts() :: keyword()
```

Returns the default options for the pulsar component.

# `render_frame`

```elixir
@spec render_frame(String.t(), non_neg_integer(), keyword()) :: Alaja.Buffer.t()
```

Renders a single frame of the pulsar animation.

Returns iodata representing the current frame.

# `render_frame_pixels`

```elixir
@spec render_frame_pixels(String.t(), non_neg_integer(), keyword()) ::
  {:ok, [[{0..255, 0..255, 0..255}]]} | {:error, String.t()}
```

Renders a single frame of the pulsar animation as pixel data.

Returns pixel data as a list of rows, each row a list of {r, g, b} tuples.
Used when content_type is :image for compositing with image protocols.

---

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