[color] Very generic colors: Rgb, Hsv and Gray
These Colors may be used on their own. F.e. passed to a colored LED driver or being emitted by color-sensor drivers.
They also represent single pixels for modm::graphic::Buffer and modm::graphic::Display (Work in progress, see feature/rewrite-graphic
Features
-
Bit granularity for
color::Gray. Same forcolor::Rgbandcolor::Hsvcause they're made from 3xcolor::Gray- Proportional conversion between grays with different digits. 2-bit Gray ---> 4-bit Gray f.e. converts as follows:
- 0b00 --> 0b0000
- 0b01 --> 0b0101 // No stupid lshift, the gap is filled up
- 0b10 --> 0b1010
- 0b11 --> 0b1111 // Saturated stays saturated, white stays white
- Proportional conversion between grays with different digits. 2-bit Gray ---> 4-bit Gray f.e. converts as follows:
-
C++20 concepts for colortypes and colorgroups (currently ColorPlane and ColorPalletizing). These concepts support overall readability and enabled very nice overload resolution modulation for
modm::graphic::Bufferandmodm::graphic::Display(Coming soon, see feature/rewrite-graphic - Any imaginable color conversion works - type, granularity, palletized or planar... doesn't matter.
- Operators with saturation arithmetics
TODO
- [x] Requires #780 being merged
- [x] Implement some missing operators
- [x] Optional range check for value in
ProportionalUnsigned::ProportionalUnsigned(T value) - [x] Update header Timestamps
This is ready for a first review @salkinium
I also got my fingers on modm::Saturated again, improved the API and added another test SaturationTest::test__uint8_t_ref.
Apologize my enduring "push --force" thunderstorm. I'm transitioning from poke mode to test local, push after success mode 😬
Tests passed @salkinium! What's left is a good solution for the ProportionalUnsigned constructor 🙄
What's missing here @salkinium ?
FileNotFoundError: [Errno 2] No such file or directory: '/__w/modm/modm/src/modm/math/propertional_unsigned.md'
Merge please!
These colors have been proven in the field. Adding code snippets to the docs (color.md) rounds up the package.
- We're left open with the issue of
modm::ProportinoalUnsigned. Please have a look on my solution @chris-durand when you find a minute.
Please have a look on my solution @chris-durand when you find a minute.
I'll try to find some time tomorrow to look at the PR.
Wanna get some stuff off the table. This PR feels robust, if you find a minute @salkinium 😅...
@TomSaw Did you see what I wrote in https://github.com/modm-io/modm/pull/781#discussion_r900488911 ? The discussion got so lengthy that github hides most of it by default :sweat_smile:
@TomSaw Did you see what I wrote in https://github.com/modm-io/modm/pull/781#discussion_r900488911 ? The discussion got so lengthy that github hides most of it by default :sweat_smile:
Nope. Totally missed that and check it tomorrow.
I'm still very interested in merging this, unfortunately, I've completely lost the overview of the review. I think it's almost done, perhaps you want to address the least comments and then we can merge it?
Hey there. Yes it was almost done. Only chris requested to extract the "arbitrary integer" logic into its own class for good reasons, see https://github.com/modm-io/modm/pull/781#discussion_r900488911 and https://github.com/modm-io/modm/pull/781#discussion_r911941799
Simple task but then, a strong force pulled me into another universe. One with a ton of PHP actually 🤕
I've just read the processing::fibers readme and it sounds gorgeous 🤩 congrats for completing this!
Nothing changed yet.. just cleaned up the tree