-
Notifications
You must be signed in to change notification settings - Fork 10
/
proof.scss
58 lines (44 loc) · 1.26 KB
/
proof.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Two intial colours and a breakdown of their HSL values
$baseColor: #7a21c5;
$baseHue: hue($baseColor);
$baseSat: saturation($baseColor);
$baseLight: lightness($baseColor);
$targetColor: #91c2c5;
$targetHue: hue($targetColor);
$targetSat: saturation($targetColor);
$targetLight: lightness($targetColor);
.baseComponents {
hue: $baseHue;
saturation: $baseSat;
lightness: $baseLight;
}
.targetComponents {
hue: $targetHue;
saturation: $targetSat;
lightness: $targetLight;
}
// Work out the adjustments
$hueAdjustment: $targetHue - $baseHue;
$satAdjustment: $baseSat - $targetSat;
$lightAdjustment: $targetLight - $baseLight;
.adjustments {
hueAdjust: $hueAdjustment;
satAdjust: $satAdjustment;
lightAdjust: $lightAdjustment;
}
// Apply the adjustments to another instance of the base color
$newColor: #7a21c5; // Should be same as $baseColor - not sure how variables persist in sass so redeclaring manually
$newColor: adjust-hue($newColor, $hueAdjustment);
$newColor: desaturate($newColor, $satAdjustment);
$newColor: lighten($newColor, $lightAdjustment);
.newcolor {
color: $newColor;
}
$newHue: hue($newColor);
$newSat: saturation($newColor);
$newLight: lightness($newColor);
.newColorComponents {
hue: $newHue;
sat: $newSat;
light: $newLight;
}