Skip to content
New issue

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

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

Already on GitHub? # to your account

Add BLACK, WHITE, TRANSPARENT constants to color types. #64

Merged
merged 1 commit into from
Nov 24, 2024

Conversation

waywardmonkeys
Copy link
Collaborator

These are useful values to have without having to go to the palette. Additionally, this allows for getting the correct value for the colorspace for white without having to go through a conversion.

Fixes #63.

These are useful values to have without having to go to the
palette. Additionally, this allows for getting the correct
value for the colorspace for white without having to go through
a conversion.

Fixes #63.
@waywardmonkeys
Copy link
Collaborator Author

This is one of the changes that will help make using color in peniko and vello a bit easier.

@waywardmonkeys waywardmonkeys added this to the 0.2.0 milestone Nov 24, 2024
Copy link
Contributor

@raphlinus raphlinus left a comment

Choose a reason for hiding this comment

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

Looks great, thanks! I agree this is useful to have.

@waywardmonkeys waywardmonkeys merged commit 5fc2645 into main Nov 24, 2024
15 checks passed
@waywardmonkeys waywardmonkeys deleted the color-black-white-transparent-constants branch November 24, 2024 03:58
@@ -15,12 +15,20 @@ You can find its changes [documented below](#010-2024-11-20).

This release has an [MSRV][] of 1.82.

### Added

* Add `BLACK`, `WHITE`, and `TRANSPARENT` constants to the color types. ([#64][] by [@waywardmonkeys][])
Copy link
Member

Choose a reason for hiding this comment

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

Is it worth noting that this is a breaking change?

It feels like there's an interesting thing here, that ideally we'd have different definitions of breaking for creators of custom colorspaces and users of the crate - creators of custom colorspaces are so rare that kind of mad.

I guess color would probably be a good use-case for the semver-trick.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There will be some other breaking changes as well. But I guess we could call out that ColorSpace must have a WHITE_COMPONENTS const now?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, that is the breaking change. Our standards for marking breaking changes aren't very developed.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add more color constants?
3 participants