Index

Builtins

MMO\client\scs · 1 symbol · generated 5 Oct 2026

class

Builtins

Builtins.php:14

The standard library of Simple CSS (the spec, 41).

class MMO\client\scs\Builtins
Namespace
MMO\client\scs
It 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://mcp.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) staticMove 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) staticMix two colors. $weight is how much of $color1 is kept (50% by default).
fnNth($collection, $index) static1-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) staticrgba($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

Adjust($color, $delta)

staticBuiltins.php:147

Move a color's hsl lightness by $delta percent.

protected static function Adjust(MMO\client\scs\Value $color, float $delta): MMO\client\scs\Value
$colorValue
$deltafloat
returnsValue

Call($name, $args, $origin, $location)

staticBuiltins.php:26
static function Call( string $name, array $args, mixed $origin = null, ?MMO\client\scs\SourceLocation $location = null ): MMO\client\scs\Value
$namestring
$argsarray
$origin = nullmixedthe object reporting an error
$location = nullnull | SourceLocation
returnsValue

fnAbs($n)

staticBuiltins.php:52
protected static function fnAbs(MMO\client\scs\Value $n): MMO\client\scs\Value
$nValue
returnsValue

fnCeil($n)

staticBuiltins.php:51
protected static function fnCeil(MMO\client\scs\Value $n): MMO\client\scs\Value
$nValue
returnsValue

fnDarken($color, $amount)

staticBuiltins.php:122
protected static function fnDarken(MMO\client\scs\Value $color, MMO\client\scs\Value $amount): MMO\client\scs\Value
$colorValue
$amountValue
returnsValue

fnEm($n)

staticBuiltins.php:43
protected static function fnEm(MMO\client\scs\Value $n): MMO\client\scs\Value
$nValue
returnsValue

fnFloor($n)

staticBuiltins.php:50
protected static function fnFloor(MMO\client\scs\Value $n): MMO\client\scs\Value
$nValue
returnsValue

fnGet($collection, $key, $default)

staticBuiltins.php:72
protected static function fnGet( MMO\client\scs\Value $collection, MMO\client\scs\Value $key, ?MMO\client\scs\Value $default = null ): MMO\client\scs\Value
$collectionValue
$keyValue
$default = nullnull | Value
returnsValue

fnIf($condition, $then, $else)

staticBuiltins.php:95
protected static function fnIf( MMO\client\scs\Value $condition, MMO\client\scs\Value $then, MMO\client\scs\Value $else ): MMO\client\scs\Value
$conditionValue
$thenValue
$elseValue
returnsValue

fnKeys($map)

staticBuiltins.php:77
protected static function fnKeys(MMO\client\scs\Value $map): MMO\client\scs\Value
$mapValue
returnsValue

fnLength($collection)

staticBuiltins.php:61
protected static function fnLength(MMO\client\scs\Value $collection): MMO\client\scs\Value
$collectionValue
returnsValue

fnLighten($color, $amount)

staticBuiltins.php:118
protected static function fnLighten(MMO\client\scs\Value $color, MMO\client\scs\Value $amount): MMO\client\scs\Value
$colorValue
$amountValue
returnsValue

fnMix($color1, $color2, $weight)

staticBuiltins.php:129

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
$color1Value
$color2Value
$weight = nullnull | Value
returnsValue

fnNth($collection, $index)

staticBuiltins.php:66

1-based, like css nth-child.

protected static function fnNth(MMO\client\scs\Value $collection, MMO\client\scs\Value $index): MMO\client\scs\Value
$collectionValue
$indexValue
returnsValue

fnPercent($n)

staticBuiltins.php:44
protected static function fnPercent(MMO\client\scs\Value $n): MMO\client\scs\Value
$nValue
returnsValue

fnPercentage($n)

staticBuiltins.php:45
protected static function fnPercentage(MMO\client\scs\Value $n): MMO\client\scs\Value
$nValue
returnsValue

fnPx($n)

staticBuiltins.php:41
protected static function fnPx(MMO\client\scs\Value $n): MMO\client\scs\Value
$nValue
returnsValue

fnQuote($value)

staticBuiltins.php:86
protected static function fnQuote(MMO\client\scs\Value $value): MMO\client\scs\Value
$valueValue
returnsValue

fnRem($n)

staticBuiltins.php:42
protected static function fnRem(MMO\client\scs\Value $n): MMO\client\scs\Value
$nValue
returnsValue

fnRgb($args)

staticBuiltins.php:103
protected static function fnRgb(MMO\client\scs\Value ...$args): MMO\client\scs\Value
...$argsValue
returnsValue

fnRgba($args)

staticBuiltins.php:110

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
...$argsValue
returnsValue

fnRound($n, $precision)

staticBuiltins.php:47
protected static function fnRound(MMO\client\scs\Value $n, ?MMO\client\scs\Value $precision = null): MMO\client\scs\Value
$nValue
$precision = nullnull | Value
returnsValue

fnToLowerCase($value)

staticBuiltins.php:89
protected static function fnToLowerCase(MMO\client\scs\Value $value): MMO\client\scs\Value
$valueValue
returnsValue

fnToUpperCase($value)

staticBuiltins.php:88
protected static function fnToUpperCase(MMO\client\scs\Value $value): MMO\client\scs\Value
$valueValue
returnsValue

fnUnit($n)

staticBuiltins.php:54
protected static function fnUnit(MMO\client\scs\Value $n): MMO\client\scs\Value
$nValue
returnsValue

fnUnitless($n)

staticBuiltins.php:55
protected static function fnUnitless(MMO\client\scs\Value $n): MMO\client\scs\Value
$nValue
returnsValue

fnUnquote($value)

staticBuiltins.php:87
protected static function fnUnquote(MMO\client\scs\Value $value): MMO\client\scs\Value
$valueValue
returnsValue

Rgb($color)

staticBuiltins.php:157
protected static function Rgb(MMO\client\scs\Value $color): array
$colorValuea hex color, a css color name or a rgb() call
returnsarrayint, g: int, b: int}

ToHsl($rgb)

staticBuiltins.php:168
protected static function ToHsl(array $rgb): array
$rgbarray
returnsarrayfloat, 1: float, 2: float} hue (0-1), saturation (0-1), lightness (0-1)