PHP 클래스 SassScriptFunctions

A collection of functions for use in SassSCript.
파일 보기 프로젝트 열기: richthegeek/phpsass

공개 프로퍼티들

프로퍼티 타입 설명
$parser

공개 메소드들

메소드 설명
_if ( SassBoolean $condition, mixed $if_true, mixed $if_false ) : mixed An inline "if-else" statement.
abs ( SassNumber $number ) : SassNumber Finds the absolute value of a number.
adjust ( SassColour $colour, SassNumber $amount, boolean $ofCurrent, string $att, boolean $op, float $min, float $max, string $units = '' ) : SassColour Adjusts the colour
adjust_color ( SassColour $color, integer $red, integer $green, integer $blue, integer $hue, integer $saturation, integer $lightness, integer $alpha ) : SassColour Adjusts one or more property of the color by the value requested.
adjust_hue ( SassColour $colour, SassNumber $degrees ) : SassColour Changes the hue of a colour while retaining the lightness and saturation.
alpha ( SassColour $colour ) : SassNumber Returns the alpha component (opacity) of a colour.
append ( $list, $val, $sep = ', ' )
blue ( SassColour $colour ) : SassNumber Returns the blue component of a colour.
ceil ( SassNumber $number ) : SassNumber Rounds a number up to the nearest whole number.
change_color ( SassColour $color, boolean $red = false, boolean $green = false, boolean $blue = false, boolean $hue = false, boolean $saturation = false, boolean $lightness = false, boolean $alpha = false ) : SassColour Changes one or more properties of the color to the requested value
comparable ( SassNumber $number1, SassNumber $number2 ) : SassBoolean Returns true if two numbers are similar enough to be added, subtracted, or compared.
complement ( SassColour $colour ) : SassColour Returns the complement of a colour.
darken ( SassColour $colour, SassNumber $amount, SassBoolean $ofCurrent = false ) : SassColour Makes a colour darker.
desaturate ( SassColour $colour, SassNumber $amount, SassBoolean $ofCurrent = false ) : SassColour Makes a colour less saturated.
fade_in ( SassColour $colour, SassNumber $amount, SassBoolean $ofCurrent = false ) : SassColour Makes a colour more opaque.
fade_out ( SassColour $colour, SassNumber $amount, SassBoolean $ofCurrent = false ) : SassColour Makes a colour more transparent.
floor ( SassNumber $number ) : SassNumber Rounds down to the nearest whole number.
get_var ( $string ) : SassString Returns the variable whose name is the string.
grayscale ( SassColour $colour ) : SassColour Greyscale for non-english speakers.
green ( SassColour $colour ) : SassNumber Returns the green component of a colour.
greyscale ( SassColour $colour ) : SassColour Converts a colour to greyscale.
hsl ( float $h, mixed $s, mixed $l ) : SassColour Creates a SassColour object from hue, saturation, and lightness.
hsla ( SassNumber $h, SassNumber $s, SassNumber $l, float $a ) : SassColour Creates a SassColour object from hue, saturation, lightness and alpha channel (opacity).
hue ( SassColour $colour ) : SassNumber Returns the hue component of a colour.
ie_hex_str ( $color ) returns an IE hex string for a color with an alpha channel suitable for passing to IE filters.
inRange ( float $value, float $min, float $max ) : mixed Ensures the value is within the given range, clipping it if needed.
index ( $list, $value )
invert ( SassColour $colour ) : SassColour: Inverts a colour.
join ( $one, $two, $sep = ', ' )
length ( $list ) : SassNumber Returns the length of the $list
lighten ( SassColour $colour, SassNumber $amount, SassBoolean $ofCurrent = false ) : SassColour Makes a colour lighter.
lightness ( SassColour $colour ) : SassNumber Returns the lightness component of a colour.
max ( )
min ( )
mix ( SassColour $colour1, SassColour $colour2, float $weight = '50%' ) : SassColour Mixes two colours together.
nth ( $list, $n ) : mixed Returns the nth value ofthe $list
opacify ( SassColour $colour, SassNumber $amount, $ofCurrent = false ) : SassColour Makes a colour more opaque.
opacity ( SassColour $colour ) : SassNumber Returns the alpha component (opacity) of a colour.
option ( $name )
percentage ( SassNumber $number ) : SassNumber Converts a decimal number to a percentage.
quote ( string $string ) : SassString Add quotes to a string if the string isn't quoted, or returns the same string if it is.
red ( SassColour $colour ) : SassNumber Returns the red component of a colour.
rgb ( SassNumber $red, SassNumber $green, SassNumber $blue ) : SassColour Creates a SassColour object from red, green, and blue values.
rgba ( ) : SassColour Creates a SassColour object from red, green, and blue values and alpha channel (opacity).
round ( SassNumber $number ) : SassNumber Rounds a number to the nearest whole number.
saturate ( SassColour $colour, SassNumber $amount, $ofCurrent = false ) : SassColour Makes a colour more saturated.
saturation ( SassColour $colour ) : SassNumber Returns the saturation component of a colour.
scale_color ( SassColour $color, integer $red, integer $green, integer $blue, integer $saturation, integer $lightness, integer $alpha ) : SassColour Scales one or more property of the color by the percentage requested.
shade ( SassColour $colour, SassNumber $amount ) : SassColour Changes the shade of a colour, mixing it with the $amount of black.
tint ( SassColour $colour, SassNumber $amount ) : SassColour Changes the tint of a colour, mixing it with the $amount of white.
transparentize ( SassColour $colour, SassNumber $amount, $ofCurrent = false ) : SassColour Makes a colour more transparent.
type_of ( SassLiteral $obj ) : SassString Inspects the type of the argument, returning it as an unquoted string.
unit ( SassNumber $number ) : SassString Inspects the unit of the number, returning it as a quoted string.
unitless ( SassNumber $number ) : SassBoolean Inspects the unit of the number, returning a boolean indicating if it is unitless.
units ( SassNumber $number ) : SassString Inspects the units of the number, returning it as a quoted string.
unquote ( string $string ) : SassString Removes quotes from a string if the string is quoted, or returns the same string if it's not.
zip ( ) New function zip allows several lists to be combined into one list of lists. For example: zip(1px 1px 3px, solid dashed solid, red green blue) becomes 1px solid red, 1px dashed green, 3px solid blue

메소드 상세

_if() 공개 정적인 메소드

An inline "if-else" statement.
public static _if ( SassBoolean $condition, mixed $if_true, mixed $if_false ) : mixed
$condition SassBoolean - values are loosely-evaulated by PHP, so 'false' includes null, false, 0, ''
$if_true mixed returns if Condition is true
$if_false mixed returns if Condition is false
리턴 mixed

abs() 공개 정적인 메소드

For example: abs(10px) => 10px abs(-10px) => 10px
public static abs ( SassNumber $number ) : SassNumber
$number SassNumber number to round
리턴 SassNumber The absolute value of the number

adjust() 공개 정적인 메소드

Adjusts the colour
public static adjust ( SassColour $colour, SassNumber $amount, boolean $ofCurrent, string $att, boolean $op, float $min, float $max, string $units = '' ) : SassColour
$colour SassColour the colour to adjust
$amount SassNumber the amount to adust by
$ofCurrent boolean whether the amount is a proportion of the current value or the total range
$att string the attribute to adjust
$op boolean whether to decrease (false) or increase (true) the value of the attribute
$min float minimum value the amount can be
$max float maximum value the amount can bemixed
$units string amount units
리턴 SassColour

adjust_color() 공개 정적인 메소드

Adjusts one or more property of the color by the value requested.
public static adjust_color ( SassColour $color, integer $red, integer $green, integer $blue, integer $hue, integer $saturation, integer $lightness, integer $alpha ) : SassColour
$color SassColour the colour to adjust
$red integer
$green integer
$blue integer
$hue integer
$saturation integer
$lightness integer
$alpha integer
리턴 SassColour

adjust_hue() 공개 정적인 메소드

Changes the hue of a colour while retaining the lightness and saturation.
public static adjust_hue ( SassColour $colour, SassNumber $degrees ) : SassColour
$colour SassColour The colour to adjust
$degrees SassNumber The amount to adjust the colour by
리턴 SassColour The adjusted colour

alpha() 공개 정적인 메소드

Returns the alpha component (opacity) of a colour.
public static alpha ( SassColour $colour ) : SassNumber
$colour SassColour The colour
리턴 SassNumber The alpha component (opacity) of colour

append() 공개 정적인 메소드

public static append ( $list, $val, $sep = ', ' )

blue() 공개 정적인 메소드

Returns the blue component of a colour.
public static blue ( SassColour $colour ) : SassNumber
$colour SassColour The colour
리턴 SassNumber The blue component of colour

ceil() 공개 정적인 메소드

For example: ceil(10.4px) => 11px ceil(10.6px) => 11px
public static ceil ( SassNumber $number ) : SassNumber
$number SassNumber The number to round
리턴 SassNumber The rounded number

change_color() 공개 정적인 메소드

Changes one or more properties of the color to the requested value
public static change_color ( SassColour $color, boolean $red = false, boolean $green = false, boolean $blue = false, boolean $hue = false, boolean $saturation = false, boolean $lightness = false, boolean $alpha = false ) : SassColour
$color SassColour the color to change
$red boolean
$green boolean
$blue boolean
$hue boolean
$saturation boolean
$lightness boolean
$alpha boolean
리턴 SassColour

comparable() 공개 정적인 메소드

Returns true if two numbers are similar enough to be added, subtracted, or compared.
public static comparable ( SassNumber $number1, SassNumber $number2 ) : SassBoolean
$number1 SassNumber The first number to test
$number2 SassNumber The second number to test
리턴 SassBoolean True if the numbers are similar

complement() 공개 정적인 메소드

Rotates the hue by 180 degrees.
public static complement ( SassColour $colour ) : SassColour
$colour SassColour The colour
리턴 SassColour The comlemented colour

darken() 공개 정적인 메소드

Makes a colour darker.
또한 보기: adjust
public static darken ( SassColour $colour, SassNumber $amount, SassBoolean $ofCurrent = false ) : SassColour
$colour SassColour The colour to darken
$amount SassNumber The amount to darken the colour by
$ofCurrent SassBoolean Whether the amount is a proportion of the current value (true) or the total range (false). The default is false - the amount is a proportion of the total range. If the colour lightness value is 80% and the amount is 50%, the resulting colour lightness value is 30% if the amount is a proportion of the total range, whereas it is 40% if the amount is a proportion of the current value.
리턴 SassColour The darkened colour

desaturate() 공개 정적인 메소드

Makes a colour less saturated.
또한 보기: adjust
public static desaturate ( SassColour $colour, SassNumber $amount, SassBoolean $ofCurrent = false ) : SassColour
$colour SassColour The colour to desaturate
$amount SassNumber The amount to desaturate the colour by
$ofCurrent SassBoolean Whether the amount is a proportion of the current value (true) or the total range (false). The default is false - the amount is a proportion of the total range. If the colour saturation value is 80% and the amount is 50%, the resulting colour saturation value is 30% if the amount is a proportion of the total range, whereas it is 40% if the amount is a proportion of the current value.
리턴 SassColour The desaturateed colour

fade_in() 공개 정적인 메소드

Alias for {@link opacify}.
또한 보기: opacify
public static fade_in ( SassColour $colour, SassNumber $amount, SassBoolean $ofCurrent = false ) : SassColour
$colour SassColour The colour to opacify
$amount SassNumber The amount to opacify the colour by
$ofCurrent SassBoolean Whether the amount is a proportion of the current value (true) or the total range (false).
리턴 SassColour The opacified colour

fade_out() 공개 정적인 메소드

Alias for {@link transparentize}.
또한 보기: transparentize
public static fade_out ( SassColour $colour, SassNumber $amount, SassBoolean $ofCurrent = false ) : SassColour
$colour SassColour The colour to transparentize
$amount SassNumber The amount to transparentize the colour by
$ofCurrent SassBoolean Whether the amount is a proportion of the current value (true) or the total range (false).
리턴 SassColour The transparentized colour

floor() 공개 정적인 메소드

For example: floor(10.4px) => 10px floor(10.6px) => 10px
public static floor ( SassNumber $number ) : SassNumber
$number SassNumber The number to round
리턴 SassNumber The rounded number

get_var() 공개 정적인 메소드

Returns the variable whose name is the string.
public static get_var ( $string ) : SassString
리턴 SassString

grayscale() 공개 정적인 메소드

Greyscale for non-english speakers.
또한 보기: desaturate
public static grayscale ( SassColour $colour ) : SassColour
$colour SassColour The colour
리턴 SassColour The greyscale colour

green() 공개 정적인 메소드

Returns the green component of a colour.
public static green ( SassColour $colour ) : SassNumber
$colour SassColour The colour
리턴 SassNumber The green component of colour

greyscale() 공개 정적인 메소드

Reduces the saturation to zero.
또한 보기: desaturate
public static greyscale ( SassColour $colour ) : SassColour
$colour SassColour The colour
리턴 SassColour The greyscale colour

hsl() 공개 정적인 메소드

Uses the algorithm from the {@link http://www.w3.org/TR/css3-colour/#hsl-colour CSS3 spec}.
public static hsl ( float $h, mixed $s, mixed $l ) : SassColour
$h float The hue of the colour in degrees. Should be between 0 and 360 inclusive
$s mixed The saturation of the colour as a percentage. Must be between '0%' and 100%, inclusive
$l mixed The lightness of the colour as a percentage. Must be between 0% and 100%, inclusive
리턴 SassColour The resulting colour

hsla() 공개 정적인 메소드

Creates a SassColour object from hue, saturation, lightness and alpha channel (opacity).
public static hsla ( SassNumber $h, SassNumber $s, SassNumber $l, float $a ) : SassColour
$h SassNumber The hue of the colour in degrees. Should be between 0 and 360 inclusive
$s SassNumber The saturation of the colour as a percentage. Must be between 0% and 100% inclusive
$l SassNumber The lightness of the colour as a percentage. Must be between 0% and 100% inclusive
$a float The alpha channel. A number between 0 and 1.
리턴 SassColour The resulting colour

hue() 공개 정적인 메소드

Returns the hue component of a colour.
public static hue ( SassColour $colour ) : SassNumber
$colour SassColour The colour
리턴 SassNumber The hue component of colour

ie_hex_str() 공개 정적인 메소드

returns an IE hex string for a color with an alpha channel suitable for passing to IE filters.
public static ie_hex_str ( $color )

inRange() 공개 정적인 메소드

Ensures the value is within the given range, clipping it if needed.
public static inRange ( float $value, float $min, float $max ) : mixed
$value float the value to test
$min float the minimum value
$max float the maximum value
리턴 mixed the value clipped to the range

index() 공개 정적인 메소드

public static index ( $list, $value )

invert() 공개 정적인 메소드

The red, green, and blue values are inverted value = (255 - value)
public static invert ( SassColour $colour ) : SassColour:
$colour SassColour the colour
리턴 SassColour:

join() 공개 정적인 메소드

public static join ( $one, $two, $sep = ', ' )

length() 공개 정적인 메소드

Returns the length of the $list
public static length ( $list ) : SassNumber
리턴 SassNumber

lighten() 공개 정적인 메소드

Makes a colour lighter.
또한 보기: lighten_rel
public static lighten ( SassColour $colour, SassNumber $amount, SassBoolean $ofCurrent = false ) : SassColour
$colour SassColour The colour to lighten
$amount SassNumber The amount to lighten the colour by
$ofCurrent SassBoolean Whether the amount is a proportion of the current value (true) or the total range (false). The default is false - the amount is a proportion of the total range. If the colour lightness value is 40% and the amount is 50%, the resulting colour lightness value is 90% if the amount is a proportion of the total range, whereas it is 60% if the amount is a proportion of the current value.
리턴 SassColour The lightened colour

lightness() 공개 정적인 메소드

Returns the lightness component of a colour.
public static lightness ( SassColour $colour ) : SassNumber
$colour SassColour The colour
리턴 SassNumber The lightness component of colour

max() 공개 정적인 메소드

public static max ( )

min() 공개 정적인 메소드

public static min ( )

mix() 공개 정적인 메소드

Takes the average of each of the RGB components, optionally weighted by the given percentage. The opacity of the colours is also considered when weighting the components. The weight specifies the amount of the first colour that should be included in the returned colour. The default, 50%, means that half the first colour and half the second colour should be used. 25% means that a quarter of the first colour and three quarters of the second colour should be used. For example: mix(#f00, #00f) => #7f007f mix(#f00, #00f, 25%) => #3f00bf mix(rgba(255, 0, 0, 0.5), #00f) => rgba(63, 0, 191, 0.75)
public static mix ( SassColour $colour1, SassColour $colour2, float $weight = '50%' ) : SassColour
$colour1 SassColour The first colour
$colour2 SassColour The second colour
$weight float Percentage of the first colour to use
리턴 SassColour The mixed colour

nth() 공개 정적인 메소드

Returns the nth value ofthe $list
public static nth ( $list, $n ) : mixed
리턴 mixed

opacify() 공개 정적인 메소드

Makes a colour more opaque.
또한 보기: opacify_rel
public static opacify ( SassColour $colour, SassNumber $amount, $ofCurrent = false ) : SassColour
$colour SassColour The colour to opacify
$amount SassNumber The amount to opacify the colour by If this is a unitless number between 0 and 1 the adjustment is absolute, if it is a percentage the adjustment is relative. If the colour alpha value is 0.4 if the amount is 0.5 the resulting colour alpha value is 0.9, whereas if the amount is 50% the resulting colour alpha value is 0.6.
리턴 SassColour The opacified colour

opacity() 공개 정적인 메소드

Returns the alpha component (opacity) of a colour.
public static opacity ( SassColour $colour ) : SassNumber
$colour SassColour The colour
리턴 SassNumber The alpha component (opacity) of colour

option() 공개 정적인 메소드

public static option ( $name )

percentage() 공개 정적인 메소드

For example: percentage(100px / 50px) => 200%
public static percentage ( SassNumber $number ) : SassNumber
$number SassNumber The decimal number to convert to a percentage
리턴 SassNumber The number as a percentage

quote() 공개 정적인 메소드

Add quotes to a string if the string isn't quoted, or returns the same string if it is.
또한 보기: unquote
public static quote ( string $string ) : SassString
$string string String to quote
리턴 SassString Quoted string

red() 공개 정적인 메소드

Returns the red component of a colour.
public static red ( SassColour $colour ) : SassNumber
$colour SassColour The colour
리턴 SassNumber The red component of colour

rgb() 공개 정적인 메소드

Creates a SassColour object from red, green, and blue values.
public static rgb ( SassNumber $red, SassNumber $green, SassNumber $blue ) : SassColour
$red SassNumber the red component. A number between 0 and 255 inclusive, or between 0% and 100% inclusive
$green SassNumber the green component. A number between 0 and 255 inclusive, or between 0% and 100% inclusive
$blue SassNumber the blue component. A number between 0 and 255 inclusive, or between 0% and 100% inclusive
리턴 SassColour new SassColour SassColour object

rgba() 공개 정적인 메소드

There are two overloads: * rgba(red, green, blue, alpha)
public static rgba ( ) : SassColour
리턴 SassColour new SassColour SassColour object

round() 공개 정적인 메소드

For example: round(10.4px) => 10px round(10.6px) => 11px
public static round ( SassNumber $number ) : SassNumber
$number SassNumber The number to round
리턴 SassNumber The rounded number

saturate() 공개 정적인 메소드

Makes a colour more saturated.
또한 보기: adjust
public static saturate ( SassColour $colour, SassNumber $amount, $ofCurrent = false ) : SassColour
$colour SassColour The colour to saturate
$amount SassNumber The amount to saturate the colour by
리턴 SassColour The saturated colour

saturation() 공개 정적인 메소드

Returns the saturation component of a colour.
public static saturation ( SassColour $colour ) : SassNumber
$colour SassColour The colour
리턴 SassNumber The saturation component of colour

scale_color() 공개 정적인 메소드

Scales one or more property of the color by the percentage requested.
public static scale_color ( SassColour $color, integer $red, integer $green, integer $blue, integer $saturation, integer $lightness, integer $alpha ) : SassColour
$color SassColour the colour to adjust
$red integer
$green integer
$blue integer
$saturation integer
$lightness integer
$alpha integer
리턴 SassColour

shade() 공개 정적인 메소드

Changes the shade of a colour, mixing it with the $amount of black.
public static shade ( SassColour $colour, SassNumber $amount ) : SassColour
$colour SassColour The colour to adjust
$amount SassNumber The amount of black to mix with the $colour
리턴 SassColour The adjusted colour

tint() 공개 정적인 메소드

Changes the tint of a colour, mixing it with the $amount of white.
public static tint ( SassColour $colour, SassNumber $amount ) : SassColour
$colour SassColour The colour to adjust
$amount SassNumber The amount of white to mix with the $colour
리턴 SassColour The adjusted colour

transparentize() 공개 정적인 메소드

Makes a colour more transparent.
public static transparentize ( SassColour $colour, SassNumber $amount, $ofCurrent = false ) : SassColour
$colour SassColour The colour to transparentize
$amount SassNumber The amount to transparentize the colour by. If this is a unitless number between 0 and 1 the adjustment is absolute, if it is a percentage the adjustment is relative. If the colour alpha value is 0.8 if the amount is 0.5 the resulting colour alpha value is 0.3, whereas if the amount is 50% the resulting colour alpha value is 0.4.
리턴 SassColour The transparentized colour

type_of() 공개 정적인 메소드

Inspects the type of the argument, returning it as an unquoted string.
public static type_of ( SassLiteral $obj ) : SassString
$obj SassLiteral The object to inspect
리턴 SassString The type of object

unit() 공개 정적인 메소드

Alias for units.
또한 보기: units
public static unit ( SassNumber $number ) : SassString
$number SassNumber The number to inspect
리턴 SassString The units of the number

unitless() 공개 정적인 메소드

Inspects the unit of the number, returning a boolean indicating if it is unitless.
public static unitless ( SassNumber $number ) : SassBoolean
$number SassNumber The number to inspect
리턴 SassBoolean True if the number is unitless, false if it has units.

units() 공개 정적인 메소드

Inspects the units of the number, returning it as a quoted string.
public static units ( SassNumber $number ) : SassString
$number SassNumber The number to inspect
리턴 SassString The units of the number

unquote() 공개 정적인 메소드

Removes quotes from a string if the string is quoted, or returns the same string if it's not.
또한 보기: quote
public static unquote ( string $string ) : SassString
$string string String to unquote
리턴 SassString Unuoted string

zip() 공개 메소드

New function zip allows several lists to be combined into one list of lists. For example: zip(1px 1px 3px, solid dashed solid, red green blue) becomes 1px solid red, 1px dashed green, 3px solid blue
public zip ( )

프로퍼티 상세

$parser 공개적으로 정적으로 프로퍼티

public static $parser