pub(crate) fn scale_color(block: Block, scalar: f64, quantization: f64) -> Block {
    let scalar = (scalar / quantization).round() * quantization;
    match (block, NotNan::new(scalar as f32)) {
        (Block::Atom(attributes, color), Ok(scalar)) => Block::Atom(
            attributes,
            (color.to_rgb() * scalar).with_alpha(color.alpha()),
        ),
        (block, _) => block,
    }
}
/// Generate a copy of a [`Block::Atom`] with its color scaled by the given scalar.
///
/// The scalar is rounded to steps of `quantization`, to reduce the number of distinct
/// block types generated.
///
/// If the computation is NaN or the block is not an atom, it is returned unchanged.
Generate a copy of a [`Block::Atom`] with its color scaled by the given scalar.
The scalar is rounded to steps of `quantization`, to reduce the number of distinct
block types generated.

If the computation is NaN or the block is not an atom, it is returned unchanged.
Generate a copy of a [ ` Block :: Atom ` ] with its color scaled by the given scalar . The scalar is rounded to steps of ` quantization ` to reduce the number of distinct block types generated . If the computation is NaN or the block is not an atom it is returned unchanged .
pub(crate) fn scale_color(block: Block, scalar: f64, quantization: f64) -> Block {
    let scalar = (scalar / quantization).round() * quantization;
    match (block, NotNan::new(scalar as f32)) {
        (Block::Atom(attributes, color), Ok(scalar)) => Block::Atom(
            attributes,
            (color.to_rgb() * scalar).with_alpha(color.alpha()),
        ),
        (block, _) => block,
    }
}
pub ( crate ) fn scale_color ( block : Block , scalar : f64 , quantization : f64 ) -> Block { let scalar = ( scalar / quantization ) . round ( ) * quantization ; match ( block , NotNan :: new ( scalar as f32 ) ) { ( Block :: Atom ( attributes , color ) , Ok ( scalar ) ) => Block :: Atom ( attributes , ( color . to_rgb ( ) * scalar ) . with_alpha ( color . alpha ( ) ) , ) , ( block , _ ) => block , } }
Generate a copy of a [`Block::Atom`] with its color scaled by the given scalar.
Generate a copy of a [ ` Block :: Atom ` ] with its color scaled by the given scalar .
block
Block
scalar
f64
quantization
f64