Setting text color using the container's background-color:
@function set-text-color($color) {
    @if (lightness($color) > 70) {
        @return #333;
    } @else {
        @return #fff;
    }
}
Calling the function - "set-text-color":
h1 {
    background-color: $primary-color;
    color: set-text-color($primary-color);
}
by Valeri Tandilashvili
4 years ago
Sass
functions
Sass Crash Course
0
Pro tip: use ```triple backticks around text``` to write in code fences