net.weirdlings.pixel.defs

Shared definitions for small pixel-art images stored as text grids, so a drawing lives in the record itself and any app can render it without a blob.

Details · defs
Kinddefs
Authoritypixel.weirdlings.net
Commit rev3n34kclynhk2r
Indexed

#image

object

A pixel-art image: a palette and a grid of rows, top row first. In each row, '.' is a transparent pixel and the characters 1-9 then a-z pick palette colours 1 to 35, in that order (so '1' is the first colour, 'a' the tenth). Every row has exactly width characters and there are exactly height rows.

Properties

height

requiredinteger

Height in pixels.

  • minimum: 1
  • maximum: 64

palette

requiredref
Reference

rows

requiredarray

The grid, top row first: height rows of width characters each.

  • minLength: 1
  • maxLength: 64
itemsstring
  • minLength: 1
  • maxLength: 64

width

requiredinteger

Width in pixels.

  • minimum: 1
  • maximum: 64

#palette

object

The colours an image's characters index into, carried in the record so the image renders the same everywhere, even if the palette it came from changes later.

Properties

colors

requiredarray

Up to 35 colours as #rrggbb hex, in order: entry 1 is drawn by '1', entry 10 by 'a'.

  • minLength: 1
  • maxLength: 35
itemsstring
  • minLength: 7
  • maxLength: 7

name

string

Optional name of the palette the colours came from, like "field". Informational: always draw from colors.

  • maxLength: 64