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

Function channel

src/apps/cli/src/ui/theme.rs:577–584  ·  view source on GitHub ↗
(v: u8)

Source from the content-addressed store, hash-verified

575
576fn relative_luminance(r: u8, g: u8, b: u8) -> f64 {
577 fn channel(v: u8) -> f64 {
578 let v = v as f64 / 255.0;
579 if v <= 0.03928 {
580 v / 12.92
581 } else {
582 ((v + 0.055) / 1.055).powf(2.4)
583 }
584 }
585
586 0.2126 * channel(r) + 0.7152 * channel(g) + 0.0722 * channel(b)
587}

Callers 15

relative_luminanceFunction · 0.85
register_pendingMethod · 0.85
call_implMethod · 0.85
sendMethod · 0.85
newMethod · 0.85
start_bot_connectionMethod · 0.85
restore_botMethod · 0.85
create_watcherMethod · 0.85

Calls

no outgoing calls