Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/thingsym/hugo-theme-techdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/scss/function/_contrast-color.scss')
-rw-r--r--src/scss/function/_contrast-color.scss12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/scss/function/_contrast-color.scss b/src/scss/function/_contrast-color.scss
index 75f341c..3867958 100644
--- a/src/scss/function/_contrast-color.scss
+++ b/src/scss/function/_contrast-color.scss
@@ -1,9 +1,13 @@
+@charset "utf-8";
+
+// Built-In Modules
+@use 'sass:math';
+@use 'sass:color';
+
// ===================================================================
// contrast color
// ===================================================================
-@charset "utf-8";
-
@function contrast-color($color: null, $dark: #000, $light: #fff) {
@if $color == null {
@return null;
@@ -13,10 +17,10 @@
$light-color-brightness: brightness($light);
$dark-color-brightness: brightness($dark);
- @return if(abs($color-brightness - $light-color-brightness) > abs($color-brightness - $dark-color-brightness), $light, $dark);
+ @return if(math.abs($color-brightness - $light-color-brightness) > math.abs($color-brightness - $dark-color-brightness), $light, $dark);
}
}
@function brightness($color: null) {
- @return ((red($color) * 299) + (green($color) * 587) + (blue($color) * 114)) / 1000;
+ @return ((color.red($color) * 299) + (color.green($color) * 587) + (color.blue($color) * 114)) / 1000;
}