From 14499e4659897c99d0d6ee17a6c58f2baa2dc146 Mon Sep 17 00:00:00 2001 From: grovesNL Date: Fri, 28 Oct 2022 01:15:02 -0230 Subject: [PATCH] Remove `HasColor` --- examples/hello-world.rs | 16 +--------------- src/lib.rs | 6 ------ 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/examples/hello-world.rs b/examples/hello-world.rs index 91883c3..9a271ad 100644 --- a/examples/hello-world.rs +++ b/examples/hello-world.rs @@ -1,5 +1,5 @@ use cosmic_text::{Attrs, FontSystem, SwashCache, TextBuffer, TextMetrics}; -use glyphon::{Color, HasColor, Resolution, TextAtlas, TextRenderer}; +use glyphon::{Resolution, TextAtlas, TextRenderer}; use wgpu::{ Backends, CommandEncoderDescriptor, CompositeAlphaMode, DeviceDescriptor, Features, Instance, Limits, LoadOp, Operations, PresentMode, RenderPassColorAttachment, RenderPassDescriptor, @@ -17,20 +17,6 @@ fn main() { pollster::block_on(run()); } -#[derive(Clone, Copy)] -struct GlyphUserData; - -impl HasColor for GlyphUserData { - fn color(&self) -> Color { - Color { - r: 255, - g: 255, - b: 0, - a: 255, - } - } -} - static mut FONT_SYSTEM: Option = None; async fn run() { diff --git a/src/lib.rs b/src/lib.rs index 6e13b9f..bd68490 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -26,12 +26,6 @@ pub struct Color { pub a: u8, } -/// Allows text to be colored during rendering. -pub trait HasColor: Copy { - /// The color to use when rendering text. - fn color(&self) -> Color; -} - pub(crate) enum GpuCache { InAtlas { x: u16, y: u16 }, SkipRasterization,