Skip to content

Use color for color.#63

Merged
waywardmonkeys merged 1 commit intolinebender:mainfrom
waywardmonkeys:use-color
Nov 27, 2024
Merged

Use color for color.#63
waywardmonkeys merged 1 commit intolinebender:mainfrom
waywardmonkeys:use-color

Conversation

@waywardmonkeys
Copy link
Collaborator

@waywardmonkeys waywardmonkeys commented Nov 23, 2024

Color functionality is now provided by the color crate.

@waywardmonkeys waywardmonkeys force-pushed the use-color branch 2 times, most recently from f165bcf to 304ab8c Compare November 23, 2024 05:44
@waywardmonkeys
Copy link
Collaborator Author

waywardmonkeys commented Nov 23, 2024

Some of these will be resolved in color and some here in this crate:

@waywardmonkeys waywardmonkeys force-pushed the use-color branch 3 times, most recently from 0b9d293 to 63060d0 Compare November 23, 2024 06:45
@waywardmonkeys
Copy link
Collaborator Author

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 FIXME(color) comments in the code to help point to things that need resolution in conjunction with the list in a comment above.

@waywardmonkeys
Copy link
Collaborator Author

I think I will remove the legacy code instead, and export a type alias Color that is the same as AlphaColor<Srgb> as that would simplify updating Vello.

@waywardmonkeys waywardmonkeys force-pushed the use-color branch 2 times, most recently from 52da6e8 to c65c325 Compare November 24, 2024 05:47
@tomcur
Copy link
Member

tomcur commented Nov 25, 2024

(Just a note: with color becoming 32-bit per channel, maybe peniko::Image::alpha should become f32.)

peniko/src/image.rs

Lines 37 to 50 in d825bdf

pub struct Image {
/// Blob containing the image data.
pub data: Blob<u8>,
/// Pixel format of the image.
pub format: Format,
/// Width of the image.
pub width: u32,
/// Height of the image.
pub height: u32,
/// Extend mode.
pub extend: Extend,
/// An additional alpha multiplier to use with the image.
pub alpha: u8,
}

@waywardmonkeys waywardmonkeys force-pushed the use-color branch 2 times, most recently from ab4783e to 117742c Compare November 27, 2024 05:38
@waywardmonkeys waywardmonkeys force-pushed the use-color branch 2 times, most recently from e4a2477 to 0fef133 Compare November 27, 2024 06:50
@waywardmonkeys
Copy link
Collaborator Author

This is now rebased on top of #65 and includes the changes needed for the MSRV bump. The MSRV bump ended up being much simpler once the old peniko::Color was gone along with the changes in #65, so it didn't add significant noise to this PR.

@waywardmonkeys waywardmonkeys marked this pull request as ready for review November 27, 2024 06:51
@waywardmonkeys
Copy link
Collaborator Author

(Just a note: with color becoming 32-bit per channel, maybe peniko::Image::alpha should become f32.)

I did this in #65 as it let me simplify some of the MSRV issues.

Copy link
Member

@xStrom xStrom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some initial thoughts on the changelog. 😈

@waywardmonkeys waywardmonkeys force-pushed the use-color branch 2 times, most recently from a3cb839 to 0d5c2da Compare November 27, 2024 10:38
Copy link
Member

@xStrom xStrom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not tried running the code with Vello or anything like that, but the code changes look fine to me.

/// directly without cloning or allocating.
#[derive(Copy, Clone, PartialEq, Debug)]
#[cfg_attr(
target_pointer_width = "32",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙃

Color functionality is now provided by the `color` crate.
@waywardmonkeys waywardmonkeys added this pull request to the merge queue Nov 27, 2024
Merged via the queue into linebender:main with commit cb75a00 Nov 27, 2024
@waywardmonkeys waywardmonkeys deleted the use-color branch November 27, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants