I have the following Sass mixin, which is a half complete modification of an RGBa example:
@mixin ba
If you need to mix colour from variable and alpha transparency, and with solutions that include rgba() function you get an error like
background-color: rgba(#{$color}, 0.3);
^
$color: #002366 is not a color.
╷
│ background-color: rgba(#{$color}, 0.3);
│ ^^^^^^^^^^^^^^^^^^^^
Something like this might be useful.
$meeting-room-colors: (
Neumann: '#002366',
Turing: '#FF0000',
Lovelace: '#00BFFF',
Shared: '#00FF00',
Chilling: '#FF1493',
);
$color-alpha: EE;
@each $name, $color in $meeting-room-colors {
.#{$name} {
background-color: #{$color}#{$color-alpha};
}
}