_functions.scss 592 B

1234567891011121314151617181920212223
  1. //////////////////////////////
  2. // Calculations
  3. @function offset-background-color($color, $percent) {
  4. @if (lightness($color) < 50) {
  5. @return lighten($color, $percent);
  6. } @else {
  7. @return darken($color, $percent);
  8. }
  9. }
  10. @function offset-foreground-color($color, $percent) {
  11. @if (lightness($color) > 50) {
  12. @return lighten($color, $percent);
  13. } @else {
  14. @return darken($color, $percent);
  15. }
  16. }
  17. @function fade-foreground-color($color, $percent) {
  18. @if (lightness($color) < 50) {
  19. @return lighten($color, $percent);
  20. } @else {
  21. @return darken($color, $percent);
  22. }
  23. }