RGB color values are not clamped to the interval [0.0, 1.0]
- Dominant language
- Rust
- Stars
- 1.8k
- Forks
- 195
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 2
Description
Not only does kiss3d permit RGB values that are not within the interval [0.0, 1.0], but values outside this interval actually display as different colors.
For instance, take the example code that kiss3d provides, which displays a red, rotating cube, and replace the line
```rust
c.set_color(1.0, 0.0, 0.0);
```
with
```rust
c.set_color(2.0, 0.0, 0.0);
```
It compiles (which it arguably shouldn't) _and_ it actually renders as a different color, which is much more problematic. This means that if one sticks to values between 0.0 and 1.0, they cannot display the full color gamut, which can be a nontrivial handicap.
Likewise, replacing the aforementioned line with
```rust
c.set_color(-2.0, 0.0, 0.0);
```
actually renders a dark aquamarine or turquoise color, rather than black as I would expect (I would actually expect it to not compile at all, but that's beside the point).
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue names the set_color call and the rotating-cube example, but no source files or tests. Trace set_color from that example through the rendering path and check existing color-related tests. The expected handling of values outside [0.0, 1.0] needs maintainer clarification; done should include agreed behavior and regression coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100