{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "fx-preset",
  "title": "Effects presets",
  "description": "Resolves the preset and temperament props of an effect into colors, intensity and speed.",
  "dependencies": [],
  "devDependencies": [],
  "registryDependencies": [
    "https://reactmotionkit.com/r/motion-presets.json"
  ],
  "files": [
    {
      "path": "lib/fx-preset.ts",
      "content": "import { DEFAULT_TEMPERAMENT, type Temperament } from \"@/lib/motion\"\n\n/** A named combination of colours (any CSS colour) and strength. */\nexport interface FxPreset {\n  colors: string[]\n  /** Multiplier on the effect's strength: 1 = as designed, under 1 quieter, over 1 stronger. */\n  intensity: number\n}\n\n/** What an effect reads: colours, strength and playback speed, ready to feed shaders and loops. */\nexport interface FxSettings {\n  colors: string[]\n  intensity: number\n  speed: number\n}\n\n/**\n * Speed and strength per temperament. These are visual-effect multipliers, not animation\n * timings, so they live here rather than in the `temperaments` table (which has no pixel or\n * shader quantities); `lively` is the design as authored.\n */\nexport const fxTemperaments: Record<Temperament, { speed: number; intensity: number }> = {\n  calm: { speed: 0.6, intensity: 0.75 },\n  lively: { speed: 1, intensity: 1 },\n  playful: { speed: 1.3, intensity: 1.2 },\n}\n\n/**\n * Resolves the `preset` and `temperament` props of an effect: the preset gives colours and base\n * intensity, the temperament scales intensity and sets the speed; explicit props win.\n */\nexport function resolveFx<K extends string>(\n  presets: Record<K, FxPreset>,\n  preset: K,\n  temperament: Temperament = DEFAULT_TEMPERAMENT,\n  overrides: { colors?: string[]; intensity?: number; speed?: number } = {},\n): FxSettings {\n  const base = presets[preset]\n  const scale = fxTemperaments[temperament]\n  return {\n    colors: overrides.colors ?? base.colors,\n    intensity: overrides.intensity ?? base.intensity * scale.intensity,\n    speed: overrides.speed ?? scale.speed,\n  }\n}\n",
      "type": "registry:lib"
    }
  ],
  "meta": {
    "tier": "free",
    "collection": "interface",
    "needsImage": false,
    "addedAt": "2026-11-08",
    "tags": [
      "effects",
      "preset",
      "temperament"
    ],
    "tech": [],
    "presets": [],
    "keyboard": [],
    "heavy": false
  },
  "categories": [
    "internal"
  ],
  "type": "registry:lib"
}