# Graphical Grid

The unit at [gr/grid.fs] implements [io/grid] on a [gr/buf] by drawing cells
as [gr/font] glyphs.

Its color palette follows the VGA default palette.

This unit basically have one relevant word, "grgrid$ ( font -- )". This
initializes the grid and sets it as the active Grid. Example initialization:

  needs gr/font/uf2 io/grid lib/idle io/key gr/grid
  "data/font/term12.uf2" loaduf2 grgrid$
  :> grid write# ; console!
  ' refreshgrid idleadd
  ' refreshcaret ' promptforkey realias

## API

### Values

CARETCOLOR  Color, in [io/grid] encoding, of the caret. Default LBLUE/LGREEN.

### Words

grgrid$ ( font -- )
  Initialize the graphical grid with the specified font [gr/font].

refreshgrid ( -- )
  Loop over [io/grid]'s "getnextchange", drawing each changed cell, until all
  changes have been processed.

refreshcaret ( -- )
  Redraw the caret, possible "undrawing" the old one. This implies a
  "refreshgrid" before caret drawing occurs.

