MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / mix_u8

Function mix_u8

crates/opencode-tui/src/components/toast.rs:179–183  ·  view source on GitHub ↗
(from: u8, to: u8, alpha: f32)

Source from the content-addressed store, hash-verified

177}
178
179fn mix_u8(from: u8, to: u8, alpha: f32) -> u8 {
180 let from = from as f32;
181 let to = to as f32;
182 (from + (to - from) * alpha).round().clamp(0.0, 255.0) as u8
183}
184
185fn color_to_rgb(color: Color) -> (u8, u8, u8) {
186 match color {

Callers 1

blend_colorsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected