-
Notifications
You must be signed in to change notification settings - Fork 12
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
Use color
for color.
#63
base: main
Are you sure you want to change the base?
Conversation
f165bcf
to
304ab8c
Compare
Some of these will be resolved in
|
0b9d293
to
63060d0
Compare
I've done more work here updating most of the gradient code, adding a feature to disable the legacy color code, and adding some more comments. There are some |
src/brush.rs
Outdated
@@ -37,7 +48,8 @@ impl From<Image> for Brush { | |||
|
|||
impl Default for Brush { | |||
fn default() -> Self { | |||
Self::Solid(Color::default()) | |||
// FIXME(color): Decide what to do about color and defaults | |||
Self::Solid(color::palette::css::TRANSPARENT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current Peniko defaults to transparent. Opaque black can be considered: it is visible, and has a natural representation in the color spaces we include in color
. The other special color is white, though the physical color it represents depends on the color space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a previous PR with discussion about it: #31 and that links to more discussion in Xilem.
We'll also have to decide whether to solve it here in the Brush::default()
only or also in color
or both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, with linebender/color#63 in place, this would be shorter …
I think I will remove the legacy code instead, and export a type alias |
63060d0
to
52da6e8
Compare
This leaves `peniko::Color` for now, but begins the migration to using the new `color` crate.
52da6e8
to
c65c325
Compare
(Just a note: with color becoming 32-bit per channel, maybe Lines 37 to 50 in d825bdf
|
This leaves
peniko::Color
for now, but begins the migration to using the newcolor
crate.