Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,49 @@ blazon dist -r truchet
Colour is derived in OKLCH with gamut mapping, held in a lightness band that
keeps contrast on both a white page and a dark terminal.

## Hosted marks

If all you want is a mark in a README, there is an endpoint for it:

```
https://api.blazon.build/v1/mark/1.4.2.svg
https://api.blazon.build/v1/mark/1.4.2.svg?renderer=flowfield&bg=dark
https://api.blazon.build/v1/mark/1.4.2.png?renderer=bishop&size=112
```

`/v1/mark/{version}.{svg|png|txt}`, with `renderer`, `size`, `padding`,
`policy`, `palette`, `bg`, `cols` and `nocolor` spelled exactly as the CLI
spells them. `/v1/renderers` lists what exists and the current size ceilings;
`/v1/healthz` reports which release is deployed. A mark is a pure function of
its URL, so the answers are cacheable forever and are served that way.

It runs the same code this repository publishes — the deploy compares every
response against a `go run` of the same version, byte for byte, and refuses to
ship on a disagreement. So the marks are the marks. What differs is the budget.

**Prefer SVG.** It is the format the service is comfortable with: its cost is
whatever the renderer's own maths costs and does not grow with the requested
size, so it is served at any size up to 1024 with no per-renderer limit.

**PNG is capped**, because rasterising and deflating cost the square of the
edge length and the deployment has ten milliseconds of CPU per request. The
ceilings are measured, published at `/v1/renderers`, and currently run from 48
to 112 pixels depending on the renderer. `flowfield` is not served as PNG at
all: its streamline integration costs the same at sixteen pixels as at
five hundred, so there is no size at which it fits.

These are limits of one small deployment, not of the library. `blazon.PNG` has
no ceiling, no renderer is excluded, and rendering locally costs a few
milliseconds:

```go
data, err := blazon.PNG("1.4.2", blazon.Options{Renderer: "flowfield", Size: 1024})
```

The service is best effort and carries no availability promise. Anything that
matters should render its own marks — that is the whole point of a library
with no dependencies.

## Gallery

Generated by `blazon gallery` and verified in CI: if the committed images stop
Expand Down