@use 'sass:color';
@use 'sass:math';

/**
 * Mixes a given color with black.
 *
 * @param    {color}     $color          The original color.
 * @param    {number}    $amount [10]    Amount of the black color in the result color (%).
 *
 * @return   {color}     The result color.
 */
@function shade($color, $amount: 10) {
	$mixed: color.mix(#000000, $color, $amount * 1%, rgb);
	$r: math.round(color.channel($mixed, 'red'));
	$g: math.round(color.channel($mixed, 'green'));
	$b: math.round(color.channel($mixed, 'blue'));

	@return rgb($r, $g, $b);
}
