$value: (360 + $value) % 360;
you add you value to 360 (if the value is negative it will be subtracted) and then modulo 360 (meaning the rest of a division by 360)
|
@while $value >= 360 { |
|
$value: $value - 360; |
|
} |
|
@while $value < 0 { |
|
$value: $value + 360; |
|
} |
made a JS example: https://codepen.io/meodai/pen/dcc6b03dbde04469bc54fead46235c7a
you add you value to
360(if the value is negative it will be subtracted) and then modulo 360 (meaning the rest of a division by 360)color/src/scss/functions/_color-func-ryb.scss
Lines 69 to 74 in c1016ae
made a JS example: https://codepen.io/meodai/pen/dcc6b03dbde04469bc54fead46235c7a