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

Add helper function to determine if color is transparent #10310

Merged
merged 6 commits into from
Oct 31, 2023

Conversation

TimJentzsch
Copy link
Contributor

Objective

  • We need to check multiple times if a color is fully transparent, e.g. for performance optimizations.
  • Make code more readable.
  • Reduce code duplication, to simplify making changes if needed (e.g. if we need to take floating point weirdness into account later on).

Solution

  • Introduce a new Color::is_fully_transparent helper function to determine if the alpha of a color is 0.
  • Use the helper function in our UI rendering code.

Changelog

  • Added Color::is_fully_transparent helper function.

@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Oct 31, 2023
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Oct 31, 2023
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Oct 31, 2023
Merged via the queue into bevyengine:main with commit d67fbd5 Oct 31, 2023
24 checks passed
ameknite pushed a commit to ameknite/bevy that referenced this pull request Nov 6, 2023
…10310)

# Objective

- We need to check multiple times if a color is fully transparent, e.g.
for performance optimizations.
- Make code more readable.
- Reduce code duplication, to simplify making changes if needed (e.g. if
we need to take floating point weirdness into account later on).

## Solution

- Introduce a new `Color::is_fully_transparent` helper function to
determine if the alpha of a color is 0.
- Use the helper function in our UI rendering code.

---

## Changelog

- Added `Color::is_fully_transparent` helper function.

---------

Co-authored-by: François <[email protected]>
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request Jan 9, 2024
…10310)

# Objective

- We need to check multiple times if a color is fully transparent, e.g.
for performance optimizations.
- Make code more readable.
- Reduce code duplication, to simplify making changes if needed (e.g. if
we need to take floating point weirdness into account later on).

## Solution

- Introduce a new `Color::is_fully_transparent` helper function to
determine if the alpha of a color is 0.
- Use the helper function in our UI rendering code.

---

## Changelog

- Added `Color::is_fully_transparent` helper function.

---------

Co-authored-by: François <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants