Documentations › mmo.client › php › scs Builtins MMO\client\scs · 1 symbol · generated 30 Sep 2026
The standard library of Simple CSS (the spec, 41).
class MMO\client\scs\Builtins Namespace MMO\client\scsIt stays deliberately small: anything css can already express at runtime (`calc`, `clamp`, `min`, `max`,
`var`, ...) is **not** evaluated but emitted as written -- see [`Parser::CSS_FUNCTIONS`](https://mmoframework.fr/documentation/mmo.client/php/scs/Parser.md#parser-css-functions). Everything here
is a compile-time value generator instead. Builtins::Call('darken', [Value::Ident('#6366f1'), Value::Number(10, '%')]); // #4f51ed
Index Adjust($color, $delta) static Move a color's hsl lightness by $delta percent. Call($name, $args, $origin, $location) static fnAbs($n) static fnCeil($n) static fnDarken($color, $amount) static fnEm($n) static fnFloor($n) static fnGet($collection, $key, $default) static fnIf($condition, $then, $else) static fnKeys($map) static fnLength($collection) static fnLighten($color, $amount) static fnMix($color1, $color2, $weight) static Mix two colors. $weight is how much of $color1 is kept (50% by default). fnNth($collection, $index) static 1-based, like css nth-child. fnPercent($n) static fnPercentage($n) static fnPx($n) static fnQuote($value) static fnRem($n) static fnRgb($args) static fnRgba($args) static rgba($color, $alpha) resolves the color at compile time, rgba(r, g, b, a) is emitted as written.fnRound($n, $precision) static fnToLowerCase($value) static fnToUpperCase($value) static fnUnit($n) static fnUnitless($n) static fnUnquote($value) static Has($name) static Hue($p, $q, $t) static Rgb($color) static ToHsl($rgb) static ToRgb($h, $s, $l) static
Methods32 Move a color's hsl lightness by $delta percent.
protected static function Adjust(MMO\client\scs\Value $color, float $delta): MMO\client\scs\Value static function Call(
string $name,
array $args,
mixed $origin = null,
?MMO\client\scs\SourceLocation $location = null
): MMO\client\scs\Value protected static function fnAbs(MMO\client\scs\Value $n): MMO\client\scs\Value protected static function fnCeil(MMO\client\scs\Value $n): MMO\client\scs\Value protected static function fnDarken(MMO\client\scs\Value $color, MMO\client\scs\Value $amount): MMO\client\scs\Value protected static function fnEm(MMO\client\scs\Value $n): MMO\client\scs\Value protected static function fnFloor(MMO\client\scs\Value $n): MMO\client\scs\Value protected static function fnGet(
MMO\client\scs\Value $collection,
MMO\client\scs\Value $key,
?MMO\client\scs\Value $default = null
): MMO\client\scs\Value protected static function fnIf(
MMO\client\scs\Value $condition,
MMO\client\scs\Value $then,
MMO\client\scs\Value $else
): MMO\client\scs\Value protected static function fnKeys(MMO\client\scs\Value $map): MMO\client\scs\Value protected static function fnLength(MMO\client\scs\Value $collection): MMO\client\scs\Value protected static function fnLighten(MMO\client\scs\Value $color, MMO\client\scs\Value $amount): MMO\client\scs\Value Mix two colors. $weight is how much of $color1 is kept (50% by default).
protected static function fnMix(
MMO\client\scs\Value $color1,
MMO\client\scs\Value $color2,
?MMO\client\scs\Value $weight = null
): MMO\client\scs\Value 1-based, like css nth-child.
protected static function fnNth(MMO\client\scs\Value $collection, MMO\client\scs\Value $index): MMO\client\scs\Value protected static function fnPercent(MMO\client\scs\Value $n): MMO\client\scs\Value protected static function fnPercentage(MMO\client\scs\Value $n): MMO\client\scs\Value protected static function fnPx(MMO\client\scs\Value $n): MMO\client\scs\Value protected static function fnQuote(MMO\client\scs\Value $value): MMO\client\scs\Value protected static function fnRem(MMO\client\scs\Value $n): MMO\client\scs\Value protected static function fnRgb(MMO\client\scs\Value ...$args): MMO\client\scs\Value rgba($color, $alpha) resolves the color at compile time, rgba(r, g, b, a) is emitted as written.
protected static function fnRgba(MMO\client\scs\Value ...$args): MMO\client\scs\Value protected static function fnRound(MMO\client\scs\Value $n, ?MMO\client\scs\Value $precision = null): MMO\client\scs\Value protected static function fnToLowerCase(MMO\client\scs\Value $value): MMO\client\scs\Value protected static function fnToUpperCase(MMO\client\scs\Value $value): MMO\client\scs\Value protected static function fnUnit(MMO\client\scs\Value $n): MMO\client\scs\Value protected static function fnUnitless(MMO\client\scs\Value $n): MMO\client\scs\Value protected static function fnUnquote(MMO\client\scs\Value $value): MMO\client\scs\Value static function Has(string $name): bool protected static function Hue(float $p, float $q, float $t): float protected static function Rgb(MMO\client\scs\Value $color): array $color Value a hex color, a css color name or a rgb() call returns array int, g: int, b: int}
protected static function ToHsl(array $rgb): array $rgb array returns array float, 1: float, 2: float} hue (0-1), saturation (0-1), lightness (0-1)
protected static function ToRgb(float $h, float $s, float $l): array