Skip to content

v0.6.0

Choose a tag to compare

@github-actions github-actions released this 23 Aug 04:33
· 15 commits to main since this release
d1a8a1b

Added

Pixel art across the whole year. The font draws five rows of two shades on
Mon–Fri; a canvas is the general case — seven rows, up to 53 columns, any
of GitHub's five shades on any day, the weekend included.

  • --template NAME and --list-templates. A catalogue of whole-year
    pictures, shipped with the crate. --list-templates prints each one with a
    thumbnail, because a name and a sentence are not a picture and the point of
    choosing one is what it looks like. Contributing a template is dropping a
    .art file into art/templates/build.rs embeds every file it finds, so
    there is no list to remember to edit. Local templates in ./templates/ and
    ~/.config/mossaic/templates/ shadow the built-in ones, so a template can be
    tested under the name it will eventually ship with.

  • --matrix FILE. Draw a .art file: seven rows of 04, or of the
    blocks ░▒▓█, with # comments and a # name: / # author: /
    # description: header. A short row is padded with dark days, so an editor
    that strips trailing whitespace cannot corrupt a picture whose last column is
    dark.

  • --draw, an editor for the year itself. Arrows or hjkl to move, 04
    to paint, space to cycle a cell, the mouse to paint directly, c clear, i
    invert, u or ctrl-z undo, s save. The HUD shows the date under the
    cursor, the days at each shade, how well those shades will separate for a
    reader on any palette GitHub ships, and what the picture would cost in
    commits
    — the same arithmetic --write uses rather than an approximation
    of it. Days in the partial weeks at either end of the year are drawn as ·
    and cost nothing, because they are not days the year has.

  • --image FILE, with --invert and --dither. A PNG becomes a year:
    shrunk to the calendar keeping its aspect ratio, and quantised to five
    shades. A dark pixel becomes a busy day, the way ink reads on paper. Every
    source pixel that lands in a cell is averaged into it — the shrink is
    enormous, and sampling one pixel in twenty throws the picture away.
    --dither is Floyd–Steinberg, so a gradient reads as one rather than as four
    bands. The decoder is written here rather than pulled in: zlib is already
    present for the kitty protocol, so this costs no new dependency. PNG only,
    and it says so — a JPEG is named as a JPEG, with the one command that
    converts it.

  • art::Canvas, art::band, and plan::Plan::from_levels — the
    library half. A canvas tracks, saves, backfills and writes exactly as text
    does, and the GitHub Action reads the same JSON, because Day was already a
    band rather than a target and a level-2 day is that band with different
    numbers.

  • art::Canvas::closest_pair, and the palette rule it exists to enforce.
    GitHub's five greens are not evenly spaced: every adjacent pair is 9–20 ΔE
    apart in the worst palette it ships. {0, 2, 4} is the only three-shade set
    with no faint pair in it, and there is no clear set of four — proved by
    enumeration in the suite rather than asserted in prose.

  • The GitHub Action takes template, matrix, image, invert and
    dither.
    Exactly one of text, template, matrix or image says what
    is being drawn, and giving two is refused rather than guessed at. Every
    existing input and all twenty outputs are unchanged and work for a picture:
    a picture is the same plan underneath. matrix and image are paths in your
    repository, so a workflow without actions/checkout is told that rather than
    told the file is missing.

Changed

  • Contrast is reported for the shades that look most alike, not the
    darkest and brightest. The widest pair always flatters: a picture spanning
    levels 0 to 4 reads as ΔE 70 and can still hold two greens nobody can
    separate, because the ones sitting next to each other are 9 apart. This
    changes what --template, --matrix, --image and --draw print; a text
    plan is unaffected, since two shades have only one pair.

  • The reference template is drawn in three shades, not five. dragon.art
    used all five to demonstrate the format, which demonstrated the wrong thing:
    the rendered chart is what showed it up. It reads clearly now.

  • --top and --background are refused with a picture rather than
    silently ignored. They place letters on rows and shade the field behind
    them; a picture uses the whole week and names its own shade for every day.
    Only when typed, so the defaults nobody chose still work.

  • plan::Plan::holes counts any day past its ceiling, not only the ones
    inside the text's own block. A canvas has middle shades, and a level-2 day
    that has crept to level 4 is damage nothing takes back. This cannot change
    what a text plan reports: text gives a letter day no ceiling — brighter than
    brightest is still brightest — so there is nothing for one to pass.

  • plan::Spec carries an optional art field, the picture stored inline.
    A name would be a pointer to something that can change underneath a plan, and
    every other field here is resolved for exactly that reason. Plans written
    before this load unchanged, and a text plan is written byte-for-byte as it
    was — the field is skipped when absent.

    One direction does not work, and cannot be made to. A plan saved from a
    picture and then read by 0.5.0 or earlier draws the picture's name as
    text, because that version has no idea the art field exists and serde
    ignores what it does not know. Nothing added here can change what an already
    released binary does with a file. If you keep a canvas plan, keep a mossaic
    that understands it.