-
Notifications
You must be signed in to change notification settings - Fork 13
fix: correct house color conversion for 0-255 range #159
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
Conversation
colorArrayToHex assumed color values were 0-1 floats and multiplied by 255, but grad_meh exports use 0-255 integers. Any value > 1 was clamped to 255, making all buildings white (ffffff). Now auto-detects the range and handles both formats correctly.
Summary of ChangesHello @fank, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an issue where house colors were incorrectly rendered due to a mismatch in expected color value ranges. Previously, the system assumed 0-1 float values, leading to incorrect conversions for 0-255 integer inputs. The Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Merging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly fixes an issue with house color conversion by introducing logic to handle both 0-1 float and 0-255 integer color value ranges. The implementation auto-detects the range based on color component values, which is a robust approach for handling data from different sources. The changes are well-tested, with new test cases covering the 0-255 integer range and existing tests for the 0-1 float range still passing. The refactoring of the clamping function improves code clarity. The fix is solid and directly addresses the described problem.
Summary
colorArrayToHexassumed color values were 0-1 floats and multiplied by 255, but grad_meh exports colors as 0-255 integers (e.g.[128, 121, 118])ffffff(white) for every buildingTest plan
[128,121,118]→807976)