Using the color helpers in CanvasPaintTask.

This commit is contained in:
Adenilson Cavalcanti 2015-02-05 16:27:15 -08:00
parent c360b75e16
commit a825e59516
4 changed files with 11 additions and 4 deletions

View file

@ -2,10 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use azure::azure_hl::{DrawTarget, Color, SurfaceFormat, BackendType, StrokeOptions, DrawOptions};
use azure::azure_hl::{DrawTarget, SurfaceFormat, BackendType, StrokeOptions, DrawOptions};
use azure::azure_hl::{ColorPattern, PatternRef};
use geom::rect::Rect;
use geom::size::Size2D;
use gfx::color;
use util::task::spawn_named;
use std::borrow::ToOwned;
@ -32,8 +33,8 @@ impl CanvasPaintTask {
fn new(size: Size2D<i32>) -> CanvasPaintTask {
CanvasPaintTask {
drawtarget: CanvasPaintTask::create(size),
fill_color: ColorPattern::new(Color::new(0., 0., 0., 1.)),
stroke_color: ColorPattern::new(Color::new(0., 0., 0., 1.)),
fill_color: ColorPattern::new(color::black()),
stroke_color: ColorPattern::new(color::black()),
stroke_opts: StrokeOptions::new(1.0, 1.0),
}
}