Repository navigation
Keep a dimmed colour's zero channels at zero - #82
Merged
Merged
Conversation
DisplayColor::dimmColor lifted every channel that rounded to 0 up to 1, including the ones the colour does not have at all - so a pure red (255, 0, 0) reached the strip as (127, 1, 1) at half brightness, a red with a trace of green and blue, and black came out as a faint white. The lift has been there since the class was added in 2021, without a reason given; the test from September pinned the whole behaviour as it was, zero channels included. A channel the colour has still never rounds down to nothing, which is what keeps a lit word visible at the lowest brightness. A channel it does not have stays off, as it already did where the strip dims (Pixel::dimmColor). The byte-pair test now expects 0 for a 0 channel, and a new check dims a pure red at brightness 0 and 128. Against the old code exactly those three expectations fail. AVR flash unchanged at 48116 bytes. Built: simulator with ctest, AVR, ESP32, RP2350, both host suites; clang-tidy clean on all four builds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DisplayColor::dimmColorlifted every channel that rounded down to 0 back up to 1. That included channels the colour does not have at all. A pure red(255, 0, 0)therefore reached the strip as(127, 1, 1)at half brightness: a red with a trace of green and blue. Black came out as a faint white.The lift has been there since
DisplayColorwas added in 2021, with no reason given. The test from September recorded the behaviour exactly as it was, zero channels included.What changed
Pixel::dimmColor, which already left zero channels at 0.Measured
testColourDimmingAcrossByteRangenow expects 0 for a 0 channel. A new check dims a pure red at brightness 0 and 128. Made to fail on purpose: against the old code, exactly these three expectations fail.ctest, AVR, ESP32, RP2350, and both host-test suites.tools/documented-sizes.pypasses, and clang-tidy is clean on all four builds.This touches neither the gamma correction nor #81. The two branches are independent of each other.