Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brush can use AlphaColor<Srgb> directly #70

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/brush.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2022 the Peniko Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

use super::{Color, Gradient, Image};
use super::{Gradient, Image};

use color::{AlphaColor, ColorSpace, DynamicColor, OpaqueColor, Srgb};

Expand All @@ -12,7 +12,7 @@ use color::{AlphaColor, ColorSpace, DynamicColor, OpaqueColor, Srgb};
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum Brush {
/// Solid color brush.
Solid(Color),
Solid(AlphaColor<Srgb>),
/// Gradient brush.
Gradient(Gradient),
/// Image brush.
Expand Down Expand Up @@ -51,7 +51,7 @@ impl From<Image> for Brush {

impl Default for Brush {
fn default() -> Self {
Self::Solid(Color::TRANSPARENT)
Self::Solid(AlphaColor::<Srgb>::TRANSPARENT)
}
}

Expand Down Expand Up @@ -102,7 +102,7 @@ impl Brush {
#[derive(Copy, Clone, Debug)]
pub enum BrushRef<'a> {
/// Solid color brush.
Solid(Color),
Solid(AlphaColor<Srgb>),
/// Gradient brush.
Gradient(&'a Gradient),
/// Image brush.
Expand Down