Skip to main content

Drawing and style

How pencilmark draws puzzles, and the conventions most sudoku software shares. None of this is part of a format: a sudoku-puzzle file says what each rule means, and a renderer may draw it any way that shows that meaning. The per-puzzle style and decorations keys (Puzzle format, section 7) carry a setter's own choices.

The line colours below are the community defaults, as measured on 6,217 published puzzles drawn in SudokuPad. All values, with a dark theme, are in palette.json; tools/render_svg.py is a reference renderer that follows this page.

A renderer needs nothing beyond the rules. Sizes are in cell units (1 = a cell's side); colours are defaults that style may override, and the Palette page shows every one in both themes. Grid lines 0.031, box borders and frame 0.07 (0.09 in the dark theme, where light lines on dark read thinner). Draw order, bottom to top: cell shading, lines, cage outlines, grid lines and box borders, edge / corner clues, digits, outside clues.

RuleDefault drawing
gridThin lines between existing cells only; nothing at null positions.
boxes (box_grid, box)Thick line wherever two adjacent existing cells lie in different boxes, and around the outside of the existing cells.
rows / columnsNothing beyond the grid lines.
region diagonalThin grey line through the cell centres, extended to the outer corners of the end cells.
region window / extraLight grey shading (#d8d8d8).
region colourShading by a palette colour per rule, in rule order (#f4cccc #fce5cd #fff2cc #d9ead3 #d0e0e3 #c9daf8 #d9d2e9 #ead1dc #e6e6e6, repeating).
region disjoint / regionNothing (listed in the legend).
cageDashed outline inset 0.08 from the cell edges; sum in small type (0.25) in the top-left corner of the first cell in reading order.
sum groupLike a cage, dotted.
sum cornerSmall white circle (0.3) with the sum at the shared corner.
line thermoGrey (#cccccc) line, width 0.3; filled bulb, diameter 0.75, at cells[0].
line slow_thermoAs thermo, bulb hollow.
line whisperGreen (#67f067), width 0.15; Dutch whisper (value 4) orange (#ffa600).
line renbanPink (#f067f0), width 0.15.
line region_sumBlue (#2ecbff), width 0.15.
line palindromeGrey (#aaaaaa), width 0.15.
line entropicPeach (#ffccaa), width 0.15.
line modularTeal (#33bbaa), width 0.15.
line parityRed (#ff6666), width 0.15.
line zipperLavender (#c8adeb), width 0.15, small dot at the centre.
line betweenGrey line, width 0.1; hollow circles (0.75) at both ends.
line lockoutGrey line, width 0.05; hollow diamonds at both ends.
line double_arrowGrey line, width 0.05; hollow circles at both ends.
closed linesThe segment from the last cell back to the first is drawn too.
arrowHollow circle (0.75) on a 1-cell bulb, rounded pill over a longer bulb; each shaft a thin grey line from the bulb's edge with an open arrowhead at its last cell.
edge kropkiDot (0.25) at the midpoint: white with a black outline, or black.
edge xvThe letter X or V (height 0.3) on a white chip.
edge difference / sum / product / ratioSmall white circle (0.3) with the number; ratio shows k:1, product ×p.
edge greaterChevron at the midpoint pointing at the smaller digit, cells[1].
corner battenburgSmall 2×2 checker square (0.3) at the corner.
corner mathraxSmall white circle at the corner with value and op (10+), or E / O.
corner excludeSmall white circle at the corner with the digit.
containsOn a 2×2 block: white circle (0.45) at the corner with the digits. Otherwise the digits in small type in the top-left corner of the first cell.
appearsA small arrow in the source cell pointing along cells.
sum little_killerSmall number outside cells[0] on side, with a short arrow pointing along cells[0] → cells[1].
sum frame, sandwich, skyscraper, first_seen, distinct_count with sidePlain number outside cells[0] on side. When kinds are mixed on one side: xsum in angle brackets ⟨n⟩, skyscraper in a small square, first_seen in a small circle.
xsumPlain number outside cells[0] (⟨n⟩ when mixed).
rossiniArrow glyph outside cells[0] on side, pointing into the grid (in) or out of it (out).
cell odd / evenGrey circle / grey square (0.8) behind the digit.
cell low / highLight / dark grey diamond behind the digit.
cell set / excludeThe values in small type along the bottom of the cell; exclude struck through.
cloneThe same light shading colour for all regions of one rule (palette as for colour regions).
vudokuA grey right-angle corner: the elbow inside the vertex cell cells[0], near the corner the three cells share, the arms reaching into the arm cells. Cells that are not an L get a V through their centres.
equal_sumThin dashed outline around each segment.
isomorphic, count, global_entropy, neighbours, negativeNothing in the grid (listed in the legend).
relationThin grey connector between the two cell centres.
Vendor rulesLight highlight of the cells plus the label text in the first cell.
givensLarge digit.
candidatesSmall digits in a 3×3 keypad layout (centred for D > 9).