Move util::color to css::color

This commit is contained in:
Brian Anderson 2012-10-29 14:27:02 -07:00
parent 21cd748269
commit 81277cca75
7 changed files with 10 additions and 15 deletions

View file

@ -1,9 +1,3 @@
/** A library for handling colors and parsing css color declarations. */
// TODO: handle #rrggbb color declarations, handle rgb(r%,g%,b%),
// sanitize input / crop it to correct ranges, predefine other 130
// css-defined colors
use float::round;
use libc::types::os::arch::c95::c_double;
use css_colors::*;

View file

@ -14,7 +14,7 @@ use comm::recv;
use option::{map, is_none};
use vec::push;
use parser_util::*;
use util::color::parsing::parse_color;
use color::parsing::parse_color;
use vec::push;
type TokenReader = {stream : pipes::Port<Token>, mut lookahead : Option<Token>};

View file

@ -9,8 +9,8 @@ use css::values::Stylesheet;
use dom::element::{HTMLDivElement, HTMLHeadElement, HTMLImageElement, UnknownElement, HTMLScriptElement};
use dom::node::{Comment, Doctype, Element, Text,
Node, NodeKind, NodeTree, LayoutData};
use util::color::{Color, rgb};
use util::color::css_colors::{white, black};
use color::{Color, rgb};
use color::css_colors::{white, black};
use layout::context::LayoutContext;
#[allow(non_implicitly_copyable_typarams)]

View file

@ -4,7 +4,7 @@ stored. CSS selector-matching rules, as presented by
http://www.w3.org/TR/CSS2/selector.html are represented by nested types.
*/
use SharedColor = util::color::Color;
use SharedColor = color::Color;
use cmp::Eq;
use std::net::url::Url;

View file

@ -1,6 +1,6 @@
/* Fundamental layout structures and algorithms. */
use servo_util::color::rgb;
use css::color::rgb;
use arc = std::arc;
use arc::ARC;
use au = gfx::geometry;
@ -11,6 +11,7 @@ use core::rand;
use css::styles::SpecifiedStyle;
use css::values::{BoxSizing, Length, Px, CSSDisplay, Specified, BgColor, BgColorTransparent};
use css::values::{BdrColor, PosAbsolute};
use css::color::{Color, rgba};
use dom::element::{ElementKind, HTMLDivElement, HTMLImageElement};
use dom::node::{Element, Node, NodeData, NodeKind, NodeTree};
use geom::rect::Rect;
@ -26,7 +27,6 @@ use servo_text::text_run;
use servo_text::text_run::TextRun;
use std::net::url::Url;
use task::spawn;
use util::color::Color;
use util::range::*;
use util::tree;
@ -447,7 +447,7 @@ impl RenderBox : RenderBoxMethods {
let boxed_bgcolor = self.d().node.style().background_color;
let bgcolor = match boxed_bgcolor {
Specified(BgColor(c)) => c,
Specified(BgColorTransparent) | _ => util::color::rgba(0,0,0,0.0)
Specified(BgColorTransparent) | _ => rgba(0,0,0,0.0)
};
if !bgcolor.alpha.fuzzy_eq(&0.0) {
list.append_item(~DisplayItem::new_SolidColor(abs_bounds, bgcolor.red, bgcolor.green, bgcolor.blue));

View file

@ -55,6 +55,8 @@ pub mod css {
pub mod apply;
pub mod matching;
}
pub mod color;
}
pub mod layout {
@ -136,7 +138,6 @@ pub mod resource {
pub mod util {
pub mod tree;
pub mod color;
pub mod time;
pub mod url;
pub mod vec;

View file

@ -9,7 +9,7 @@ use gfx::geometry::Au;
use glyph::GlyphStore;
use layout::context::LayoutContext;
use libc::{c_void};
use servo_util::color;
use css::color;
use std::arc;
use servo_util::range::{Range, MutableRange};