Skip to content

Expand rgb and led capabilities#1933

Open
schluis wants to merge 3 commits intoHULKs:mainfrom
schluis:expand-rgb-and-led-capabilities
Open

Expand rgb and led capabilities#1933
schluis wants to merge 3 commits intoHULKs:mainfrom
schluis:expand-rgb-and-led-capabilities

Conversation

@schluis
Copy link
Contributor

@schluis schluis commented Jul 14, 2025

Why? What?

Needed for #1931

@github-project-automation github-project-automation bot moved this to Request for Review in Development Jul 14, 2025
@schluis schluis marked this pull request as ready for review July 14, 2025 13:06
@schluis schluis enabled auto-merge July 14, 2025 13:06
@schluis schluis requested a review from Copilot July 14, 2025 13:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds two new capabilities for handling RGB colors and LED eye patterns:

  • Introduces Rgb::invert to flip color channels.
  • Adds Eye::percentage for generating gradient steps based on a fraction.
  • Provides Eye::invert to invert all LED eye colors.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
crates/types/src/led.rs Added percentage and invert methods on Eye for gradient and inversion behavior.
crates/types/src/color.rs Implemented invert method on Rgb to invert color channels.
Comments suppressed due to low confidence (3)

crates/types/src/led.rs:67

  • Consider clamping or validating fraction to the expected 0.0–1.0 range or using 0.0 directly instead of f32::EPSILON to make the threshold logic clearer and avoid unexpected behavior for very small values.
            color_at_0: if fraction > f32::EPSILON {

crates/types/src/led.rs:110

  • Add a doc comment explaining the purpose of invert, what it inverts (e.g., color channels), and any edge cases or expected input ranges.
    pub fn invert(self) -> Self {

crates/types/src/color.rs:153

  • Add unit tests covering Rgb::invert (and also Eye::invert/Eye::percentage) to verify correct behavior across edge cases such as black, white, and boundary fraction values.
    pub fn invert(self) -> Self {

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Request for Review

Development

Successfully merging this pull request may close these issues.

3 participants