Method Register
- Namespace
- Velvet
- Assembly
- Velvet.Docs.dll
Register(string, FilterFunctionDefinition?)
Registers definition under name for
filter-[name:args] resolution. Re-registering a live name logs a warning and
overwrites; re-registering the identical definition under the same name is a silent no-op.
public static void Register(string name, FilterFunctionDefinition? definition)
Parameters
namestringFilter name as written inside the class brackets. Must be non-empty and must not contain whitespace,
:,[,],(or), and must not benone(the first four would break the class token; the rest are CSS's own function syntax and keyword, which afilter-[...]body reads as CSS rather than as a name); the built-in filter family names (blur, brightness, contrast, grayscale, hue-rotate, invert, saturate, sepia, drop-shadow) are reserved case-insensitively. Invalid names are rejected with a warning.definitionFilterFunctionDefinitionThe custom filter definition applied when the class resolves. Null (or a destroyed asset) is rejected with a warning, as is a definition declaring more than the 4 parameters a filter function can carry.