mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 09:10:08 +00:00
remove extra conversion
This commit is contained in:
parent
048d6830e1
commit
5e41a1499b
@ -34,8 +34,8 @@ pub const LIST_ITEM: &str = "•";
|
|||||||
pub const NEW_LINE: &str = "\n";
|
pub const NEW_LINE: &str = "\n";
|
||||||
|
|
||||||
// @TODO use accent colors in adw 1.6 / ubuntu 24.10+
|
// @TODO use accent colors in adw 1.6 / ubuntu 24.10+
|
||||||
const LINK_COLOR_DEFAULT: (f32, f32, f32, f32) = (53.0, 132.0, 228.0, 255.0);
|
const LINK_COLOR: ((f32, f32, f32, f32), (f32, f32, f32, f32)) =
|
||||||
const LINK_COLOR_ONHOVER: (f32, f32, f32, f32) = (53.0, 132.0, 228.0, 228.0);
|
((0.2, 0.5, 0.9, 1.0), (0.2, 0.5, 0.9, 0.9));
|
||||||
|
|
||||||
pub struct Reader {
|
pub struct Reader {
|
||||||
pub title: Option<String>,
|
pub title: Option<String>,
|
||||||
@ -63,10 +63,7 @@ impl Reader {
|
|||||||
let mut multiline = None;
|
let mut multiline = None;
|
||||||
|
|
||||||
// Init colors
|
// Init colors
|
||||||
let link_color = (
|
let link_color = (rgba(LINK_COLOR.0), rgba(LINK_COLOR.1));
|
||||||
new_rgba_from(LINK_COLOR_DEFAULT),
|
|
||||||
new_rgba_from(LINK_COLOR_ONHOVER),
|
|
||||||
);
|
|
||||||
|
|
||||||
// Init syntect highlight features
|
// Init syntect highlight features
|
||||||
let syntax = Syntax::new();
|
let syntax = Syntax::new();
|
||||||
@ -458,7 +455,6 @@ impl Reader {
|
|||||||
// Private helpers
|
// Private helpers
|
||||||
|
|
||||||
/// Create new [RGBA](https://docs.gtk.org/gdk4/struct.RGBA.html) from tuple
|
/// Create new [RGBA](https://docs.gtk.org/gdk4/struct.RGBA.html) from tuple
|
||||||
fn new_rgba_from(value: (f32, f32, f32, f32)) -> RGBA {
|
fn rgba((r, g, b, a): (f32, f32, f32, f32)) -> RGBA {
|
||||||
let (r, g, b, a) = value;
|
RGBA::new(r, g, b, a)
|
||||||
RGBA::new(r / 255.0, g / 255.0, b / 255.0, a / 255.0)
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user