Johan Alphonso Braga
WorkProjectsReadingStackCraftDesignStatusResume

Utilities

Ask anything

Elsewhere

GitHub

All projects

Tools / 2026 / Live in the browser

RoomCoat

How much paint does my room need, and which tins should I buy? Measure the room and RoomCoat works it out, doors, windows, ceilings and new plaster counted, then picks the cheapest mix of tin sizes. Dab, a paint tin, helps along the way.

RoomCoat

01

The problem

People guess at paint, and both ways of getting it wrong cost money. US paint stewardship studies assume about 10% of all paint sold goes unused, around 80 million gallons a year, and UK homes are sitting on an estimated 139 million litres. Buying too little means a second trip and a new tin that may not match. Online calculators stop at an answer like 1.7 gallons, which is not something you can buy, and the real question in the shop is whether three gallons and two quarts beat four gallons.

02

How I approached it

Walls are the room's perimeter times its height, less 20 sq ft per door and 15 per window in the US, or a standard 1981 x 762 mm door and a 1.2 m window in metric countries. Coverage starts a little under what tins print, because they quote up to on smooth sealed walls: 350 sq ft per gallon, 12 m² per litre in the UK, 14 in Australia, and the shopper can type the number from their own tin. New plaster or drywall adds a sealing coat (a separate primer in the US and Australia, a thinned mist coat in the UK), dark to light adds a top coat, and textured walls take 10% extra instead of 5%. The tins come from an unbounded knapsack over volume in millilitres, reduced by the gcd of the sizes on that country's shelf, that finds the cheapest mix holding at least what is needed; when fewer, bigger tins cost at most 5% more it offers them too. Sizes are read the way a tape measure writes them (12' 6", 12 6, 360cm, 3,6), each box says what it read, and switching between feet and metres converts what was typed. The engine is a DOM-free UMD module shared by the page and node:test, and share links carry the plan in the URL fragment.

03

The outcome

A 12'6" x 11' bedroom and a hallway in the same green need about 3.3 gallons: 3 gallons and 2 quarts for $179, with 4 gallons offered for $1 more and half a gallon extra. Rooms with the same paint share tins, ceilings get their own white, and the list copies as plain text. 18 tests cover areas, openings, coats, waste, tin choice and its tie-breaks, the cheaper-alternative rule, and length parsing in both unit systems. Checked headless in Edge at 390 px and desktop width with no console errors.

04

The mascot

Dab is a paint tin drawn in inline SVG, and the paint on Dab is the colour picked for your walls. Dab sleeps until a room is measured, then follows the pointer or the box being typed in, tips the lid when hovered and gives a tip for the current step when tapped. Dab explains each choice as it happens (a sealing coat for new plaster, an extra coat for dark to light, ceilings in their own white), frowns at a size that can't be right like a 240 foot wall, and cheers when every room is measured. Five quick taps splash paint everywhere. Everything Dab says goes through an aria-live region, Dab can be tucked away, and nothing moves under reduced motion.

05

What I learned

The area maths took an hour. Most of the work was the last step people actually face in the shop: turning litres into tins, and noticing that the cheapest answer is not always the one a person would pick.

Also shipped the same day: Four older apps got real fixes: MoodMix's energy ramp stopped swapping in the worst matches and its previews now sound like each mood, the Study Focus Redirector gets 20-20-20 eye breaks and a status display, Globe Control works with a mouse, touch or keyboard, and Vortex Builder gets undo and redo. See the commits ↗

roomcoat.johanthegoat.xyz Open in a new tab ↗
Next projectBatchwise →