Editor

All corners
CutRoundSquircle
Grid
Polygon / star

Result

Link format

An edit link opens an icon in this editor. It's the editor's URL with the icon in its fragment, in one of two forms:

  • https://www.murinelauncher.app/icon-shapes/#edit=DATA: the icon's JSON (below), compressed with raw DEFLATE (no zlib header or checksum: zlib.compressobj(9, zlib.DEFLATED, -15) in Python, new CompressionStream('deflate-raw') in JavaScript), then base64url-encoded without = padding. This is the preferred form: it's what Share produces and it keeps links short.
  • https://www.murinelauncher.app/icon-shapes/#edit-raw=JSON: the same JSON, uncompressed and percent-encoded (encodeURIComponent in JavaScript, urllib.parse.quote(json, safe='') in Python). Use it when compressing isn't possible.

Opening either one loads the icon (the previous one stays a step back in Undo); Share then gives the short link and the link that sends the shape to Murine. A link that doesn't follow the format below is ignored, and the editor keeps the icon it had.

Checking a link

A link written by hand or by a script is worth opening before it's shared: the canvas shows the shape, and anything the launcher can't use (shapes that don't touch, crossing edges) is reported in red under Result, which also disables Use in Murine. Other messages are just information: a corner whose size shrinks its neighbours, for instance, is fine if the shape looks as intended. Small fixes can be made right there. Share then has the finished links: the address of its Edit link entry is the compressed edit link (clicking the entry copies it), and Use in Murine points to the import link.

The JSON

{"shapes": [
  {"pts": [{"x": 50, "y": 4, "r": 12, "s": 0.6}, {"x": 97.6, "y": 38.5, "r": 12, "s": 0.6}, …],
   "mirror": "none"}
]}
  • The icon is drawn in a 100 × 100 box: x grows to the right, y grows down, and (0, 0) is the top-left corner. The launcher scales this box to the icon's size, so the shape should fill it and stay inside it.
  • shapes: 1 to 20 shapes. The icon is all of them together, so they must overlap or touch and make a single outline; gaps they enclose are filled in.
  • pts: the corners of one shape, 3 to 200, in order around it (either direction). Its edges must not cross each other.
  • r (optional, default 0): how far along each edge the corner's rounding reaches, in box units; 0 is a sharp corner. Where edges are too short for it, it's reduced automatically (along with its neighbours'), which is fine as long as the result looks right.
  • s (optional, default 0): the rounding's profile, 0 to 1: 0 cuts the corner straight, 0.5 is a circular arc, 1 is the smoothest (squircle-like).
  • mirror (optional, default "none"): "h" adds a copy mirrored left to right (around x = 50), "v" one mirrored top to bottom (around y = 50), "both" three copies, one per quarter.

A shape can also be an SVG outline instead of corners, for free-form curves. It can be mixed with corner shapes in the same icon, and takes mirror too:

{"path": "M 50 0 C 77.6 0 100 22.4 100 50 C 100 77.6 77.6 100 50 100 C 22.4 100 0 77.6 0 50 C 0 22.4 22.4 0 50 0 Z"}
  • path: one closed outline in the same 100 × 100 box, written in a strict form: it starts with M x y, continues with L x y (lines) and C x1 y1 x2 y2 x y (cubic curves) only, and ends with Z; absolute coordinates, every command letter and number separated by a single space, no commas. Other commands (relative ones, H/V, S, Q, A) and holes or extra outlines aren't accepted, and the outline must not cross itself. To use an existing SVG file, Add a shape → Import SVG converts it, and Share then gives the link.
  • a, x, y (optional): the outline is drawn scaled by a (default 1) and then moved by x, y (default 0).
  • ang (optional, default 0): a turn in degrees, clockwise, around the outline's centre.

Two common shapes can also be written in short, by their measurements instead of their corners: a rounded rectangle (box) and a regular polygon or star (polygon). They're turned into corners when the link is opened, so they're edited like any other corner shape. Share keeps the short form while the shape is as it was made, and writes pts once the shape itself is changed (a different mirror alone keeps it; undoing the change brings it back). They can be mixed with the other kinds in the same icon:

{"shapes": [{"polygon": [6, 1, 0, 14]}], "fit": true}
  • polygon: [sides, inner, angle, corner size, inner corner size, smoothing], the first four required.
    • sides: a whole number, 3 to 100.
    • inner: 1 for a regular polygon. Between 0 and 1, a star: it gets twice as many corners, alternating between the outer points and inner points that sit at that fraction of the outer radius (0.5 is halfway to the centre).
    • angle: a turn in degrees, clockwise. At 0 the first outer point is straight above the centre: a triangle points up, and 4 sides make a diamond (45 stands it on a flat side).
    • corner size: r (see above) of every outer point.
    • inner corner size (optional, default the corner size): r of a star's inner points.
    • smoothing (optional, default 0.5, a circular arc): s of every corner. Note that this default differs from pts, where a left-out s is 0.
    The polygon is centred on (50, 50) with its outer points 50 from the centre, so it only reaches the box's edges where a point does, and rounding pulls it in further; fit (below) makes it fill the box. Corner size is measured along the edges, not as a radius: on a regular polygon, a circular corner of radius R (smoothing 0.5) is a corner size of R × tan(180° / sides), for instance R × 0.577 on a hexagon.
  • box: [top-left, top-right, bottom-right, bottom-left, smoothing], a rectangle filling the box: the corner size (r) of each of its four corners, then the smoothing (s) of all of them (optional, default 0.5). [50, 50, 50, 50] is a circle.
  • at (optional): [x, y, width, height], a rectangle in the box to stretch the shape onto, like an image, instead of the whole box. Width and height must be above 0. Everything the shape draws in the 100 × 100 box lands in the rectangle, rounding included, so a circle in a wide one becomes an ellipse. In the editor the shape opens with that stretch (Unstretch undoes it). It's mostly useful with several shapes, to place each one.
  • angle (optional, default 0): a turn in degrees, clockwise, around the centre of the shape's rectangle (at, or the box without it), after the stretch. Unlike a polygon's own angle, it turns the stretched result.
  • mirror works as for the other shapes. For a different smoothing per corner, or any other corner layout, write the corners out as pts.

Next to shapes, an optional "fit": true scales and centres all the shapes together, keeping their places relative to each other, so that the icon's outline (rounding and mirrored copies included) fills the box in its longer direction and is centred in the other; corner sizes scale with it. With a mirror, the icon stays centred on that mirror's line, so the copies still meet. It applies to every kind of shape and happens when the link is opened, before whole (below). It isn't kept as an option: Share gives the shapes as fitted, a fitted polygon or box with the at that places it there.

Also next to shapes, an optional whole transforms the icon as a whole, after its shapes are merged (mirrored copies included), without changing them: {"shapes": [...], "whole": {"a": 0.9, "x": 5, "y": 5, "ang": 30, "flip": true}}. In order: flip (optional, default false) turns the icon over left to right within the 100 × 100 box; a (default 1) scales it and x, y (default 0) move it; ang (default 0) turns it clockwise, in degrees, around the middle of where the box now is. In the editor it's the Global card.

Example

A rounded pentagon: {"shapes":[{"pts":[{"x":50,"y":4,"r":12,"s":0.6},{"x":97.6,"y":38.5,"r":12,"s":0.6},{"x":79.4,"y":94.5,"r":12,"s":0.6},{"x":20.6,"y":94.5,"r":12,"s":0.6},{"x":2.4,"y":38.5,"r":12,"s":0.6}]}]}

A five-pointed star with rounded tips, written as a polygon and fitted to the box: {"shapes":[{"polygon":[5,0.5,0,8,3]}],"fit":true}

A cloud made of two boxes, each placed with at, then fitted together: {"shapes":[{"box":[20,20,20,20],"at":[4,48,92,34]},{"box":[50,50,50,50],"at":[24,18,50,50]}],"fit":true}