wikimedia/less.php
PHP port of the LESS processor
Loading...
Searching...
No Matches
Less_Functions Class Reference

Builtin functions. More...

Public Member Functions

 __construct ( $env, ?array $currentFileInfo=null)
 
 rgb ( $r=null, $g=null, $b=null)
 
 rgba ( $r=null, $g=null, $b=null, $a=null)
 
 hsl ( $h, $s, $l)
 
 hsla ( $h, $s, $l, $a)
 
 hsla_hue ( $h, $m1, $m2)
 
 hsv ( $h, $s, $v)
 
 hsva ( $h, $s, $v, $a)
 
 hue ( $color=null)
 
 saturation ( $color=null)
 
 lightness ( $color=null)
 
 hsvhue ( $color=null)
 
 hsvsaturation ( $color=null)
 
 hsvvalue ( $color=null)
 
 red ( $color=null)
 
 green ( $color=null)
 
 blue ( $color=null)
 
 alpha ( $color=null)
 
 luma ( $color=null)
 
 luminance ( $color=null)
 
 saturate ( $color=null, $amount=null, $method=null)
 
 desaturate ( $color=null, $amount=null, $method=null)
 
 lighten ( $color=null, $amount=null, $method=null)
 
 darken ( $color=null, $amount=null, $method=null)
 
 fadein ( $color=null, $amount=null, $method=null)
 
 fadeout ( $color=null, $amount=null, $method=null)
 
 fade ( $color=null, $amount=null)
 
 spin ( $color=null, $amount=null)
 
 mix ( $color1=null, $color2=null, $weight=null)
 
 greyscale ( $color)
 
 contrast ( $color, $dark=null, $light=null, $threshold=null)
 
 e ( $str)
 
 escape ( $str)
 
 replace ( $string, $pattern, $replacement, $flags=null)
 todo: This function will need some additional work to make it work the same as less.js
 
 _percent ( $string,... $args)
 
 unit ( $val, $unit=null)
 
 convert ( $val, $unit)
 
 round ( $n, $f=false)
 
 pi ()
 
 mod ( $a, $b)
 
 pow ( $x, $y)
 
 ceil ( $n)
 
 floor ( $n)
 
 sqrt ( $n)
 
 abs ( $n)
 
 tan ( $n)
 
 sin ( $n)
 
 cos ( $n)
 
 atan ( $n)
 
 asin ( $n)
 
 acos ( $n)
 
 min (... $args)
 
 max (... $args)
 
 getunit ( $n)
 
 argb ( $color)
 
 percentage ( $n)
 
 color ( $c)
 
 isruleset ( $n)
 
 iscolor ( $n)
 
 isnumber ( $n)
 
 isstring ( $n)
 
 iskeyword ( $n)
 
 isurl ( $n)
 
 ispixel ( $n)
 
 ispercentage ( $n)
 
 isem ( $n)
 
 isunit ( $n, $unit)
 
 tint ( $color, $amount=null)
 
 shade ( $color, $amount=null)
 
 _self ( $args)
 
 extract ( $values, $index)
 
 length ( $values)
 
 datauri ( $mimetypeNode, $filePathNode=null)
 
 svggradient ( $direction,... $stops)
 
 imagesize ( $filePathNode=null)
 
 imagewidth ( $filePathNode=null)
 
 imageheight ( $filePathNode=null)
 
 colorBlend ( $mode, $color1, $color2)
 
 multiply ( $color1=null, $color2=null)
 
 screen ( $color1=null, $color2=null)
 
 overlay ( $color1=null, $color2=null)
 
 softlight ( $color1=null, $color2=null)
 
 hardlight ( $color1=null, $color2=null)
 
 difference ( $color1=null, $color2=null)
 
 exclusion ( $color1=null, $color2=null)
 
 average ( $color1=null, $color2=null)
 
 negation ( $color1=null, $color2=null)
 

Public Attributes

 $env
 
 $currentFileInfo
 

Detailed Description

Builtin functions.

See also
https://lesscss.org/functions/

Member Function Documentation

◆ _self()

Less_Functions::_self ( $args)
See also
less-3.13.1.js#functions _SELF

◆ color()

Less_Functions::color ( $c)
See also
less-2.5.3.js#colorFunctions.color
Parameters
Less_Tree_Quoted | Less_Tree_Color | Less_Tree_Keyword$c
Returns
Less_Tree_Color

◆ datauri()

Less_Functions::datauri ( $mimetypeNode,
$filePathNode = null )
See also
less-2.5.3.js#data-uri

◆ desaturate()

Less_Functions::desaturate ( $color = null,
$amount = null,
$method = null )
Parameters
Less_Tree_Color | null$color
Less_Tree_Dimension | null$amount
Less_Tree_Quoted | Less_Tree_Color | Less_Tree_Keyword | null$method

◆ hsla_hue()

Less_Functions::hsla_hue ( $h,
$m1,
$m2 )
Parameters
float$h
float$m1
float$m2

◆ hsva()

Less_Functions::hsva ( $h,
$s,
$v,
$a )
Parameters
Less_Tree | float$h
Less_Tree | float$s
Less_Tree | float$v
float$a

◆ isunit()

Less_Functions::isunit ( $n,
$unit )
Parameters
Less_Tree$n
Less_Tree | string$unit

◆ mix()

Less_Functions::mix ( $color1 = null,
$color2 = null,
$weight = null )
Parameters
Less_Tree | null$color1
Less_Tree | null$color2
Less_Tree | null$weight

The documentation for this class was generated from the following file: