MCPcopy Create free account
hub / github.com/GCWing/BitFun / blend_alpha_channel

Function blend_alpha_channel

src/apps/cli/src/ui/theme.rs:976–981  ·  view source on GitHub ↗
(fg: u8, alpha: u8, bg: u8)

Source from the content-addressed store, hash-verified

974}
975
976fn blend_alpha_channel(fg: u8, alpha: u8, bg: u8) -> u8 {
977 let fg = fg as u16;
978 let alpha = alpha as u16;
979 let bg = bg as u16;
980 (((fg * alpha) + (bg * (255 - alpha)) + 127) / 255) as u8
981}
982
983#[cfg(test)]
984mod tests {

Callers 1

resolve_color_stringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected