v0.6.0
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 NAMEand--list-templates. A catalogue of whole-year
pictures, shipped with the crate.--list-templatesprints 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
.artfile intoart/templates/—build.rsembeds 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.artfile: seven rows of0–4, 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 orhjklto move,0–4
to paint, space to cycle a cell, the mouse to paint directly,cclear,i
invert,uorctrl-zundo,ssave. 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--writeuses 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--invertand--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.
--ditheris 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, andplan::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, becauseDaywas 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,invertand
dither. Exactly one oftext,template,matrixorimagesays 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.matrixandimageare paths in your
repository, so a workflow withoutactions/checkoutis 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,--imageand--drawprint; 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. -
--topand--backgroundare 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::holescounts 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::Speccarries an optionalartfield, 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 theartfield 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.