Skip to content

Commit 390ecab

Browse files
committed
docs for all builtin functions
1 parent 2cee7ab commit 390ecab

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

docs/docs.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -492,16 +492,33 @@ function that let's you unquote any value. It is called `e`.
492492
* `floor(number)` -- returns the floor of a numerical input
493493
* `round(number)` -- returns the rounded value of numerical input
494494

495-
* `lighten(color, percent)` -- lightens color by percent and returns it
496-
* `darken(color, percent)` -- darkens color by percent and returns it
495+
* `lighten(color, percent)` -- lightens `color` by `percent` and returns it
496+
* `darken(color, percent)` -- darkens `color` by `percent` and returns it
497497

498-
* `saturate(color, percent)` -- saturates color by percent and returns it
499-
* `desaturate(color, percent)` -- desaturates color by percent and returns it
498+
* `saturate(color, percent)` -- saturates `color` by `percent` and returns it
499+
* `desaturate(color, percent)` -- desaturates `color` by `percent` and returns it
500500

501-
* `fadein(color, percent)` -- makes color less transparent by percent and returns it
502-
* `fadeout(color, percent)` -- makes color more transparent by percent and returns it
501+
* `fadein(color, percent)` -- makes `color` less transparent by `percent` and returns it
502+
* `fadeout(color, percent)` -- makes `color` more transparent by `percent` and returns it
503503

504-
* `spin(color, amount)` -- returns a color with amount degrees added to hue
504+
* `spin(color, amount)` -- returns a color with `amount` degrees added to hue
505+
506+
* `fade(color, amount)` -- retuns a color with the alpha set to `amount`
507+
508+
* `hue(color)` -- retuns the hue of `color`
509+
510+
* `saturation(color)` -- retuns the saturation of `color`
511+
512+
* `lightness(color)` -- retuns the lightness of `color`
513+
514+
* `alpha(color)` -- retuns the alpha value of `color` or 1.0 if it doesn't have an alpha
515+
516+
* `percentage(number)` -- converts a floating point number to a percentage, eg. `0.65` -> `65%`
517+
518+
* `mix(color1, color1, percent)` -- mixes two colors by percentagle where 100%
519+
keeps all of `color1`, and 0% keeps all of `color2`. Will take into account
520+
the alpha of the colors if it exists. See
521+
<http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html#mix-instance_method>.
505522

506523
* `rgbahex(color)` -- returns a string containing 4 part hex color.
507524

lessc.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,7 @@ function lib_mix($args) {
13591359
$new[] = $first_a * $p + $second_a * ($p - 1);
13601360
}
13611361

1362-
return $new;
1362+
return $this->fixColor($new);
13631363
}
13641364

13651365
function assertColor($value, $error = "expected color value") {

0 commit comments

Comments
 (0)