sass: Add opacify() function
This is a small utility that makes a translucent color opaque.
Use this where translucent colors are not available.
This is a small utility that makes a translucent color opaque.
Use this where translucent colors are not available.
by roundabout, Sunday, 15 March 2020, 03:23:14 (1584242594), pushed by roundabout, Sunday, 11 May 2025, 13:22:50 (1746969770)
Author identity: nana-4 <hnmaigo@gmail.com>
c6565e23edd485b4b685b94c10c0fdf2529ec209
}
}
// Make translucent color opaque by blending with the background color.
@function opacify($color, $bg) {
@return mix(change-color($color, $alpha: 1), $bg, alpha($color) * 100%);
}
// Private variables for dark background colors
$-dark-background: #1F1F1F;
$-dark-surface-1dp: mix(white, $-dark-background, 5%);
$titlebar-divider: rgba($titlebar-base-fg, .12);
$titlebar-fill: rgba($titlebar-base-fg, .08);
$titlebar-entry-fill: rgba($titlebar-base-fg, .04);
// workaround for GTK3 @placeholder_text_color which doesn't allow translucent colors
$placeholder_text_color: mix($base-fg, $base, percentage(.6));
/*
FIXME this is really an API */
@define-color content_view_bg #{"" + $base};
@define-color placeholder_text_color #{"" + $placeholder_text_color};
// NOTE: @placeholder_text_color doesn't allow translucent colors.
@define-color placeholder_text_color #{"" + opacify($text2, $base)};
// For Places Sidebar diskfull indicators
.places-treeview {
-NemoPlacesTreeView-disk-full-bg-color: mix($text, $background, percentage(0.3)); // Can't use translucent colors
-NemoPlacesTreeView-disk-full-bg-color: opacify($stroke-disabled, $base-alt); // Can't use translucent colors
-NemoPlacesTreeView-disk-full-fg-color: $primary;
-NemoPlacesTreeView-disk-full-bar-width: 2px;
-NemoPlacesTreeView-disk-full-bar-radius: 0;