2020-03-21 15:02:38 +08:00
|
|
|
@function composite-color ($background-color, $color) {
|
|
|
|
$background-color-alpha: alpha($background-color);
|
|
|
|
@if $background-color-alpha != 1 {
|
|
|
|
@error "[naive-ui/styles/composite-color]: background-color isn't opaque.";
|
|
|
|
}
|
|
|
|
$color-weight: percentage(alpha($color));
|
|
|
|
$temp-color-1: scale-color($background-color, $lightness: -$color-weight);
|
|
|
|
$temp-color-2: scale-color($color, $lightness: -(100% - $color-weight));
|
2020-02-28 20:01:39 +08:00
|
|
|
@return rgb(
|
|
|
|
red($temp-color-1) + red($temp-color-2),
|
|
|
|
green($temp-color-1) + green($temp-color-2),
|
|
|
|
blue($temp-color-1) + blue($temp-color-2)
|
|
|
|
);
|
|
|
|
}
|