Feat: begin slight refactoring
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use crate::theme::sparkle;
|
||||
use crate::theme;
|
||||
use rand::Rng;
|
||||
use ratatui::buffer::Buffer;
|
||||
use ratatui::layout::Rect;
|
||||
@@ -41,8 +41,9 @@ impl Sparkles {
|
||||
|
||||
impl Widget for &Sparkles {
|
||||
fn render(self, area: Rect, buf: &mut Buffer) {
|
||||
let colors = theme::get().sparkle.colors;
|
||||
for sp in &self.sparkles {
|
||||
let color = sparkle::COLORS[sp.char_idx % sparkle::COLORS.len()];
|
||||
let color = colors[sp.char_idx % colors.len()];
|
||||
let intensity = (sp.life as f32 / 30.0).min(1.0);
|
||||
let r = (color.0 as f32 * intensity) as u8;
|
||||
let g = (color.1 as f32 * intensity) as u8;
|
||||
|
||||
Reference in New Issue
Block a user