{"record":{"id":"d8ba712b80d0d770","repo":"remotion-dev/remotion","slug":"color-has-been-renamed-to-dotcolor","errorCode":null,"errorMessage":"\"color\" has been renamed to \"dotColor\"","messagePattern":"\"color\" has been renamed to \"dotColor\"","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/halftone.ts","lineNumber":188,"sourceCode":"\toffsetY: p.offsetY ?? 0,\n\tsampling: p.sampling ?? 'bilinear',\n\tcolorMode: p.colorMode ?? 'solid',\n\tdotColor: 'dotColor' in p ? (p.dotColor ?? 'red') : 'red',\n\tinvert: p.invert ?? false,\n});\n\nconst validateHalftoneParams = (params: HalftoneParams): void => {\n\tassertEffectParamsObject(params, 'Halftone');\n\tassertOptionalFiniteNumber(params.dotSize, 'dotSize');\n\tassertOptionalFiniteNumber(params.dotSpacing, 'dotSpacing');\n\tassertOptionalFiniteNumber(params.rotation, 'rotation');\n\tassertOptionalFiniteNumber(params.offsetX, 'offsetX');\n\tassertOptionalFiniteNumber(params.offsetY, 'offsetY');\n\tassertOptionalEnum(params.shape, 'shape', HALFTONE_SHAPES);\n\tassertOptionalEnum(params.sampling, 'sampling', HALFTONE_SAMPLING);\n\tassertOptionalEnum(params.colorMode, 'colorMode', HALFTONE_COLOR_MODES);\n\tif ('color' in params && params.color !== undefined) {\n\t\tthrow new TypeError('\"color\" has been renamed to \"dotColor\"');\n\t}\n\n\tif (params.colorMode === 'source' && 'dotColor' in params) {\n\t\tthrow new TypeError(\n\t\t\t'\"dotColor\" can only be set when \"colorMode\" is \"solid\"',\n\t\t);\n\t}\n\n\tassertOptionalColor(\n\t\t'dotColor' in params ? params.dotColor : undefined,\n\t\t'dotColor',\n\t);\n\tassertOptionalBoolean(params.invert, 'invert');\n\n\tif (params.dotSize !== undefined && params.dotSize < 1) {\n\t\tthrow new TypeError(\n\t\t\t`\"dotSize\" must be >= 1, but got ${JSON.stringify(params.dotSize)}`,\n\t\t);","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/halftone.ts#L170-L206","documentation":"Thrown by validateHalftoneParams() when the params object contains a 'color' key with a non-undefined value. The halftone effect renamed its 'color' parameter to 'dotColor' in an earlier change, and this guard exists to surface the rename with a clear message instead of silently ignoring the legacy prop. It runs after the enum checks and before dotColor-specific validation.","triggerScenarios":"Calling halftone({ color: 'red' }) or halftone({ color: '#fff', shape: 'square' }) — i.e. using the old parameter name from pre-rename example code or an outdated dependency.","commonSituations":"Upgrading @remotion/effects to a version that contains the rename, while application code still passes color; copy-pasted code from old blog posts or docs; a shared component library that has not been updated.","solutions":["Rename the 'color' prop to 'dotColor' at every call site.","Search the codebase for halftone calls and confirm none pass color.","Bump any internal wrapper components that forward color to halftone."],"exampleFix":"// before\nhalftone({ color: 'red', shape: 'circle' })\n\n// after\nhalftone({ dotColor: 'red', shape: 'circle' })","handlingStrategy":"validation","validationCode":"// Reject the legacy prop before passing params to halftone().\nfunction migrateHalftoneParams<T extends Record<string, unknown>>(p: T): T {\n  if ('color' in p && (p as Record<string, unknown>).color !== undefined) {\n    throw new Error('halftone \"color\" was renamed to \"dotColor\" — please update your call site.');\n  }\n  return p;\n}","typeGuard":"function hasLegacyColorProp(p: unknown): p is { color: unknown } {\n  return typeof p === 'object' && p !== null && 'color' in p && (p as { color: unknown }).color !== undefined;\n}","tryCatchPattern":null,"preventionTips":["After upgrading @remotion/effects, grep the codebase for halftone( and check no call passes color.","Update any shared wrapper components that forward props to halftone.","Run the type-checker: the current types only allow dotColor, so a color prop should show as a TS error too."],"tags":["halftone","migration","params","breaking-change"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}