mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Kill RgbColor
This commit is contained in:
parent
f75578cbf1
commit
21cca5bb53
1 changed files with 9 additions and 22 deletions
|
@ -65,25 +65,12 @@ use style::values::{Either, RGBA};
|
||||||
use style_traits::cursor::CursorKind;
|
use style_traits::cursor::CursorKind;
|
||||||
use style_traits::CSSPixel;
|
use style_traits::CSSPixel;
|
||||||
use style_traits::ToCss;
|
use style_traits::ToCss;
|
||||||
use webrender_api::{self, BorderDetails, BorderRadius, BorderSide, BoxShadowClipMode, ColorF};
|
use webrender_api::{
|
||||||
use webrender_api::{ExternalScrollId, FilterOp, GlyphInstance, ImageRendering, LayoutRect};
|
self, BorderDetails, BorderRadius, BorderSide, BoxShadowClipMode, ColorF, ColorU,
|
||||||
use webrender_api::{LayoutSize, LayoutTransform, LayoutVector2D, LineStyle, NinePatchBorder};
|
ExternalScrollId, FilterOp, GlyphInstance, ImageRendering, LayoutRect, LayoutSize,
|
||||||
use webrender_api::{NinePatchBorderSource, NormalBorder, ScrollSensitivity, StickyOffsetBounds};
|
LayoutTransform, LayoutVector2D, LineStyle, NinePatchBorder, NinePatchBorderSource,
|
||||||
|
NormalBorder, ScrollSensitivity, StickyOffsetBounds,
|
||||||
trait RgbColor {
|
};
|
||||||
fn rgb(r: u8, g: u8, b: u8) -> Self;
|
|
||||||
}
|
|
||||||
|
|
||||||
impl RgbColor for ColorF {
|
|
||||||
fn rgb(r: u8, g: u8, b: u8) -> Self {
|
|
||||||
ColorF {
|
|
||||||
r: (r as f32) / (255.0 as f32),
|
|
||||||
g: (g as f32) / (255.0 as f32),
|
|
||||||
b: (b as f32) / (255.0 as f32),
|
|
||||||
a: 1.0 as f32,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static THREAD_TINT_COLORS: [ColorF; 8] = [
|
static THREAD_TINT_COLORS: [ColorF; 8] = [
|
||||||
ColorF {
|
ColorF {
|
||||||
|
@ -1340,7 +1327,7 @@ impl Fragment {
|
||||||
webrender_api::BorderDisplayItem {
|
webrender_api::BorderDisplayItem {
|
||||||
widths: SideOffsets2D::new_all_same(Au::from_px(1)).to_layout(),
|
widths: SideOffsets2D::new_all_same(Au::from_px(1)).to_layout(),
|
||||||
details: BorderDetails::Normal(border::simple(
|
details: BorderDetails::Normal(border::simple(
|
||||||
ColorF::rgb(0, 0, 200),
|
ColorU::new(0, 0, 200, 1).into(),
|
||||||
webrender_api::BorderStyle::Solid,
|
webrender_api::BorderStyle::Solid,
|
||||||
)),
|
)),
|
||||||
},
|
},
|
||||||
|
@ -1371,7 +1358,7 @@ impl Fragment {
|
||||||
webrender_api::LineDisplayItem {
|
webrender_api::LineDisplayItem {
|
||||||
orientation: webrender_api::LineOrientation::Horizontal,
|
orientation: webrender_api::LineOrientation::Horizontal,
|
||||||
wavy_line_thickness,
|
wavy_line_thickness,
|
||||||
color: ColorF::rgb(0, 200, 0),
|
color: ColorU::new(0, 200, 0, 1).into(),
|
||||||
style: LineStyle::Dashed,
|
style: LineStyle::Dashed,
|
||||||
},
|
},
|
||||||
)));
|
)));
|
||||||
|
@ -1397,7 +1384,7 @@ impl Fragment {
|
||||||
webrender_api::BorderDisplayItem {
|
webrender_api::BorderDisplayItem {
|
||||||
widths: SideOffsets2D::new_all_same(Au::from_px(1)).to_layout(),
|
widths: SideOffsets2D::new_all_same(Au::from_px(1)).to_layout(),
|
||||||
details: BorderDetails::Normal(border::simple(
|
details: BorderDetails::Normal(border::simple(
|
||||||
ColorF::rgb(0, 0, 200),
|
ColorU::new(0, 0, 200, 1).into(),
|
||||||
webrender_api::BorderStyle::Solid,
|
webrender_api::BorderStyle::Solid,
|
||||||
)),
|
)),
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue