Use Color in more places
This commit is contained in:
parent
4edca946ea
commit
3ece9236b3
9 changed files with 84 additions and 53 deletions
|
|
@ -1,12 +1,12 @@
|
|||
// SPDX-License-Identifier: MIT OR Apache-2.0
|
||||
|
||||
use cosmic_text::{FontSystem, SwashCache, TextAction, TextBuffer, TextMetrics};
|
||||
use orbclient::{Color, EventOption, Renderer, Window, WindowFlag};
|
||||
use cosmic_text::{Color, FontSystem, SwashCache, TextAction, TextBuffer, TextMetrics};
|
||||
use orbclient::{EventOption, Renderer, Window, WindowFlag};
|
||||
use std::{env, fs, process, thread, time::{Duration, Instant}};
|
||||
use unicode_segmentation::UnicodeSegmentation;
|
||||
|
||||
fn redraw(window: &mut Window, buffer: &mut TextBuffer<'_>, swash_cache: &mut SwashCache) {
|
||||
let bg_color = Color::rgb(0x34, 0x34, 0x34);
|
||||
let bg_color = orbclient::Color::rgb(0x34, 0x34, 0x34);
|
||||
let font_color = Color::rgb(0xFF, 0xFF, 0xFF);
|
||||
|
||||
if buffer.cursor_moved {
|
||||
|
|
@ -21,8 +21,8 @@ fn redraw(window: &mut Window, buffer: &mut TextBuffer<'_>, swash_cache: &mut Sw
|
|||
|
||||
window.set(bg_color);
|
||||
|
||||
buffer.draw(swash_cache, font_color.data, |x, y, w, h, color| {
|
||||
window.rect(x, y, w, h, Color { data: color });
|
||||
buffer.draw(swash_cache, font_color, |x, y, w, h, color| {
|
||||
window.rect(x, y, w, h, orbclient::Color { data: color.0 });
|
||||
});
|
||||
|
||||
window.sync();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue