colored text works!

This commit is contained in:
2025-06-26 14:50:14 -06:00
parent 2bb196a968
commit fd204d404b

View File

@@ -12,8 +12,12 @@ use embedded_graphics::{
}; };
use embedded_hal_bus::spi::ExclusiveDevice; use embedded_hal_bus::spi::ExclusiveDevice;
use mousefood::prelude::*; use mousefood::prelude::*;
use ratatui::{Frame, Terminal, widgets::Paragraph}; use ratatui::{
use st7365p_lcd::{Orientation, ST7365P}; Frame, Terminal,
style::{Color, Style},
widgets::Paragraph,
};
use st7365p_lcd::ST7365P;
#[embassy_executor::task] #[embassy_executor::task]
pub async fn display_task( pub async fn display_task(
@@ -27,7 +31,7 @@ pub async fn display_task(
spi_device, spi_device,
Output::new(data, Level::Low), Output::new(data, Level::Low),
Some(Output::new(reset, Level::High)), Some(Output::new(reset, Level::High)),
true, false,
true, true,
320, 320,
320, 320,
@@ -50,7 +54,7 @@ pub async fn display_task(
} }
fn draw(frame: &mut Frame) { fn draw(frame: &mut Frame) {
let greeting = Paragraph::new("Hello World!\nLine2"); let greeting = Paragraph::new("Hello World!\nLine2").style(Style::new().red());
frame.render_widget(greeting, frame.area()); frame.render_widget(greeting, frame.area());
} }