sextile.viewdata.controls

Teletext spacing attributes and the eight teletext colours.

Spacing attributes occupy positions 0x00-0x1F. Each one takes a character cell of its own, displayed as a space in the prevailing background colour. That cost is what forces the layout engine to be attribute-aware: a line of forty columns that changes colour twice has only thirty-eight columns left for text.

Positions 0x00 and 0x10 nominally select black alphanumerics and black graphics, but are not usable as transmitted attributes, so they are absent here. Black text is obtained by changing the background instead.

class sextile.viewdata.controls.Colour(*values)[source]

Bases: IntEnum

The eight teletext colours, in their canonical order.

class sextile.viewdata.controls.Attribute(*values)[source]

Bases: IntEnum

Teletext spacing attributes.

sextile.viewdata.controls.alpha_colour(colour)[source]

The spacing attribute selecting alphanumeric text in a colour.

Parameters:

colour (Colour)

Return type:

Attribute

sextile.viewdata.controls.colour_of(code)[source]

The colour a spacing attribute selects, or None if it selects none.

The inverse of alpha_colour and graphics_colour: both the alpha and the graphics colour attributes pick the same eight colours, and this reads either back. No code returns black, black having no colour attribute.

Parameters:

code (int)

Return type:

Colour | None

sextile.viewdata.controls.graphics_colour(colour)[source]

The spacing attribute selecting mosaic graphics in a colour.

Parameters:

colour (Colour)

Return type:

Attribute

sextile.viewdata.controls.is_attribute_code(code)[source]

Say whether a code position holds a spacing attribute.

Parameters:

code (int) – A code position from a frame, between 0 and 127.

Return type:

bool

Returns:

True where the position is one of the attributes that select a colour or a character set, and False where it is a character the SAA5050 displays. An attribute occupies a cell and shows as a blank, so a caller counting what a row says has to tell the two apart.