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

Function progress_ratio

crates/opencode-tui/src/components/toast.rs:161–166  ·  view source on GitHub ↗
(elapsed_ms: u64, total_ms: u64)

Source from the content-addressed store, hash-verified

159}
160
161fn progress_ratio(elapsed_ms: u64, total_ms: u64) -> f32 {
162 if total_ms == 0 {
163 return 1.0;
164 }
165 (elapsed_ms as f32 / total_ms as f32).clamp(0.0, 1.0)
166}
167
168fn blend_colors(from: Color, to: Color, alpha: f32) -> Color {
169 let alpha = alpha.clamp(0.0, 1.0);

Callers 1

animation_progressMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected