{
  "$schema": "../../schema.json",
  "id": "halftone-dots",
  "type": "background",
  "title": "Halftone Dots",
  "summary": "A halftone-dot image filter featuring customizable grids, color palettes, and dot styles.",
  "tags": [
    "background",
    "halftone-dots",
    "gentle",
    "dark",
    "image"
  ],
  "version": "1.0.0",
  "license": "MIT",
  "params": [
    {
      "name": "fit",
      "type": "string",
      "default": "cover",
      "description": "How to fit the rendered shader into the canvas dimensions (0 = none, 1 = contain, 2 = cover)",
      "group": "advanced"
    },
    {
      "name": "colorBack",
      "type": "color",
      "default": "#000000",
      "description": "background color behind the effect",
      "group": "main"
    },
    {
      "name": "colorFront",
      "type": "color",
      "default": "#E9E4D8",
      "description": "foreground color",
      "group": "main"
    },
    {
      "name": "size",
      "type": "number",
      "default": 0.5,
      "description": "dot or pattern size",
      "min": 0,
      "max": 1,
      "step": 0.005,
      "group": "main"
    },
    {
      "name": "radius",
      "type": "number",
      "default": 1.25,
      "description": "radius",
      "min": 0,
      "max": 2,
      "step": 0.01,
      "group": "main"
    },
    {
      "name": "contrast",
      "type": "number",
      "default": 0.45,
      "description": "contrast",
      "min": 0,
      "max": 1,
      "step": 0.005,
      "group": "main"
    },
    {
      "name": "originalColors",
      "type": "boolean",
      "default": false,
      "description": "Use sampled image's original colors instead of colorFront",
      "group": "advanced"
    },
    {
      "name": "inverted",
      "type": "boolean",
      "default": true,
      "description": "Inverts the image luminance, doesn't affect the color scheme, needs contrast > 0",
      "group": "advanced"
    },
    {
      "name": "grainMixer",
      "type": "number",
      "default": 0.15,
      "description": "grain mixed into the colors",
      "min": 0,
      "max": 1,
      "step": 0.005,
      "group": "advanced"
    },
    {
      "name": "grainOverlay",
      "type": "number",
      "default": 0.1,
      "description": "grain laid over the image",
      "min": 0,
      "max": 1,
      "step": 0.005,
      "group": "advanced"
    },
    {
      "name": "grid",
      "type": "enum",
      "default": "hex",
      "options": [
        "square",
        "hex"
      ],
      "description": "Grid type (0 = square, 1 = hex)",
      "group": "advanced"
    },
    {
      "name": "type",
      "type": "enum",
      "default": "gooey",
      "options": [
        "classic",
        "gooey",
        "holes",
        "soft"
      ],
      "description": "variant",
      "group": "advanced"
    }
  ],
  "install": {
    "kind": "shader-set",
    "entry": {
      "shader": "HalftoneDots",
      "props": {
        "fit": "cover",
        "colorBack": "#000000",
        "colorFront": "#E9E4D8",
        "size": 0.5,
        "radius": 1.25,
        "contrast": 0.45,
        "originalColors": false,
        "inverted": true,
        "grainMixer": 0.15,
        "grainOverlay": 0.1,
        "grid": "hex",
        "type": "gooey"
      },
      "image": "assets/materials/material-a.jpg",
      "motion": {
        "param": "size",
        "from": 0.35,
        "to": 0.6
      }
    }
  },
  "files": [
    {
      "path": "brand/assets/materials/material-a.jpg",
      "url": "https://paper-motion.vercel.app/files/material-a.jpg",
      "from": "registry/_assets/materials/material-a.jpg"
    }
  ],
  "requires": {
    "engine": ">=0.2.0"
  },
  "usage": "import { loadBrand } from 'paper-motion/brand';\n\nconst B = await loadBrand();\n// a full-frame element <div id=\"bg\"></div> behind everything:\nB.shader(s, '#bg', 'halftone-dots');",
  "notes": [
    "Paper shader `HalftoneDots` (still).",
    "Uses an image (installed to brand/assets/materials/); swap `image` for your own picture or texture.",
    "Breathes on `size` from 0.35 to 0.6 so a still shader stays alive."
  ],
  "preview": {
    "poster": "previews/halftone-dots.jpg"
  },
  "colors": [
    "#e9e4d8",
    "#000000"
  ],
  "mode": "dark",
  "motion": "gentle",
  "mood": [
    "editorial",
    "raw",
    "playful"
  ],
  "when": [
    "a field that breathes behind a title or a card",
    "a dark editorial piece",
    "you have a photo or a logo to run through it"
  ]
}