CalcExpressionEvaluator
Evaluator for CSS calc() expressions within color functions.
Supports basic arithmetic operations (+, -, *, /), parentheses,
percentage values, and variable substitution.
Methods
public function evaluate(string $expression, array $variables): float
Evaluate a calc() expression and return the numeric result.
Parameters
| Name | Type | Default |
|---|---|---|
$expression |
string | - |
$variables |
array | [] |