sass-planifolia

Vanilla Sass helper functions
git clone https://git.ce9e.org/sass-planifolia.git

commit
fd5ba85a5aead8a395c366e4083e5c0019a714c9
parent
b45b934e5a07d6de814aaa20df857d177187474b
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2017-01-28 12:54
doc: better describe second bezier parameter

Diffstat

M sass/math.scss 12 ++++++------

1 files changed, 6 insertions, 6 deletions


diff --git a/sass/math.scss b/sass/math.scss

@@ -267,10 +267,10 @@ $planifolia-math-steps-default: 32 !default;
  267   267   }
  268   268 }
  269   269 
  270    -1 @function _pf-interpolate($a, $b, $f) {
   -1   270 @function _pf-interpolate($a, $b, $t) {
  271   271   $result: ();
  272   272   @for $i from 1 through length($a) {
  273    -1     $value: nth($a, $i) * (1 - $f) + nth($b, $i) * $f;
   -1   273     $value: nth($a, $i) * (1 - $t) + nth($b, $i) * $t;
  274   274     $result: append($result, $value);
  275   275   }
  276   276   @return $result;
@@ -278,21 +278,21 @@ $planifolia-math-steps-default: 32 !default;
  278   278 
  279   279 /// Generic bezier interpolation.
  280   280 /// @param {P[]} $points
  281    -1 /// @param {number} $f
   -1   281 /// @param {number} $t position 0 .. 1
  282   282 /// @param {function(P, P, number) => P} $interpolate [_pf-interpolate]
  283   283 ///   The default is a linear interpolation between lists of numbers.
  284   284 ///   You can specify a custom interpolation function, e.g. to interpolate
  285   285 ///   between colors.
  286   286 /// @return {P} A single point.
  287    -1 @function bezier($points, $f, $interpolate: _pf-interpolate) {
   -1   287 @function bezier($points, $t, $interpolate: _pf-interpolate) {
  288   288   @if length($points) > 1 {
  289   289     $tmp: ();
  290   290     @for $i from 1 to length($points) {
  291   291       $point1: nth($points, $i);
  292   292       $point2: nth($points, $i + 1);
  293    -1       $tmp: append($tmp, call($interpolate, $point1, $point2, $f));
   -1   293       $tmp: append($tmp, call($interpolate, $point1, $point2, $t));
  294   294     }
  295    -1     @return bezier($tmp, $f, $interpolate);
   -1   295     @return bezier($tmp, $t, $interpolate);
  296   296   } @else {
  297   297     @return nth($points, 1);
  298   298   }