module BBS::Petscii::Colors

The colours of a line-by-line C64 board as two-letter constants: the C64 names of the BBS::Ansi palette, so each is an ANSI SGR sequence. A PETSCII session (session.petscii!) turns them into the C64’s own colour codes, and the width helpers of rubbs (BBS::FrameBuffer) know ANSI, where they would count PETSCII codes as text. The same sequences show on a modern terminal too.

A class gets the bare names by including the module (BBS::Petscii::Screen does, so its subclasses have them). A board’s namespace module needs ::install, because Ruby looks a bare constant up in the modules the code is lexically nested in, not in what they include:

module UI
  module Petscii
    BBS::Petscii::Colors.install(self)

    class Board            # nested: WH, LG, RV … work here
      def head = "#{WH}hello#{LG}"
    end
  end
end