{
  "schemaVersion": 1,
  "slug": "paint-calculator",
  "category": "construction",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "25e6af1a8fed877cde28398aaa324d8279a3248f576eeb4082b995f16d62651f",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/paint-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "G = A × C ÷ R; cans = ceil(G); cost = cans × P",
    "vars": [
      [
        "A",
        "Paintable area (sq ft)"
      ],
      [
        "C",
        "Number of coats"
      ],
      [
        "R",
        "Coverage (sq ft per gallon, default 350)"
      ],
      [
        "P",
        "Price per gallon"
      ]
    ],
    "note": "Cans are always rounded up to whole units; R = 0 falls back to the default coverage of 350."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-12",
    "sources": [
      {
        "name": "Sherwin-Williams — Paint coverage and amount planning",
        "url": "https://www.sherwin-williams.com/homeowners/color/color-tools/paint-calculator"
      }
    ],
    "referenceRole": "input",
    "implementationHash": "25e6af1a8fed877cde28398aaa324d8279a3248f576eeb4082b995f16d62651f",
    "basis": "G = A × C ÷ R; cans = ceil(G); cost = cans × P",
    "limitations": "Use the cited guidance and your own measurements, bills or product specifications to choose inputs. Sample defaults are not current local data."
  },
  "contract": {
    "compute": "const totalArea = area*coats; const gallons = totalArea/(coverage || 350); return { totalArea, gallons, cans: Math.ceil(gallons), cost: Math.ceil(gallons)*pricePerGallon };",
    "inputs": [
      {
        "name": "area",
        "type": "number",
        "default": 800,
        "min": 0,
        "max": 100000,
        "step": 1
      },
      {
        "name": "coats",
        "type": "number",
        "default": 2,
        "min": 1,
        "max": 5,
        "step": 1
      },
      {
        "name": "coverage",
        "type": "number",
        "default": 350,
        "min": 50,
        "max": 800,
        "step": 10,
        "slider": true
      },
      {
        "name": "pricePerGallon",
        "type": "number",
        "default": 35,
        "min": 0,
        "max": 300,
        "step": 1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "cans",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "gallons",
        "precision": 2,
        "unit": "gal"
      },
      {
        "name": "totalArea",
        "precision": 0,
        "unit": "sq ft"
      },
      {
        "name": "cost",
        "precision": 2,
        "unit": "$"
      }
    ],
    "interpret": null
  }
}
