openframeworks / openframeworks/openFrameworks

ofColor and clamping

Open
#728 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

core development-strategy documentation
Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

ofColor_:operator+= currently calls clamp() when it's done doing the +=

i imagined one of the applications of ofFloatColor would be for averaging or summing ofColor, which normally requires non-saturation semantics for +=. i could also do a / or * every += operation to avoid overflow. this doesn't have to be a bug, but it should at least be documented clearly when we discuss ofColor.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at ofColor_::operator+= and inspect how it calls clamp() after addition. Check the existing ofColor documentation and related tests, if present. Done means the intended non-saturation behavior or its documentation is clearly established, with coverage for averaging or summing colors.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.