sass-apca 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apca.scss +9 -0
- package/package.json +1 -1
package/apca.scss
CHANGED
|
@@ -62,6 +62,15 @@ $_blueMultiplier: 0.072175;
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Determine the lightness contrast of a given text and background color using the
|
|
67
|
+
* APC algorithm
|
|
68
|
+
*
|
|
69
|
+
* @param {color} $textColor Text color
|
|
70
|
+
* @param {color} $backgroundColor Background color
|
|
71
|
+
*
|
|
72
|
+
* @return {number} A number between -108 and 107 representing the lightness contrast
|
|
73
|
+
*/
|
|
65
74
|
@function contrast($textColor, $backgroundColor) {
|
|
66
75
|
@if (meta.type-of($textColor) != 'color') {
|
|
67
76
|
@error "Type Error: apca.contrast expects a color as first argument but received #{meta.type-of($textColor)}. Please provide a valid color.";
|
package/package.json
CHANGED