-
Notifications
You must be signed in to change notification settings - Fork 143
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
Refactor modm:ui:color #616
Conversation
eb21fa7
to
a122503
Compare
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.
So far so good!
7e6d12a
to
1688174
Compare
e3814e9
to
6c43130
Compare
Edit: Got some new ideas and investigate this in another session... color_test.hpp is work in progress Stay tuned... |
3c4956c
to
779c042
Compare
81645e0
to
631610d
Compare
I'm busy with work so this slowed down. Let me finish up the color-tests + CI-claims so you can merge the state. The impros fit the goal of "refactoring color" and are worth being shared with the folks! @salkinium These Rgb-Calculations, Saturated-stuff and upainter-integrations then receive their personal silent hours in a fresh PR. |
b9b04a8
to
48b9734
Compare
I refactored your branch a little myself instead of giving you a bazillion comments. I mostly changed style and removed some top-level Apart from the relative/normalize color functions I'm happy with this now! |
I'll check it firstly in the morning + and gonna add these tests so we can clean the table: Got pretty good drive today optimizing the dusty graphic algorithms witch is lots more fun. |
Didn't want to touch the relative/normalize stuff in Rgb since it doesn't hurt me (to much), I actually have no usage for it and especially didn't want to break someone's algos. |
Few more sessions general improvements on the graphics API and my head is ready to study upainter and see what we can make with all of it. |
1c24c4d
to
20a4842
Compare
37fcd15
to
3bd752e
Compare
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.
I extracted the weird RGB normalize into their own standalone function.
Wunderbar. I've been very dismotivated to do that... thanks @salkinium 🍬 |
... instead, i've made great strides with the graphics functions. Anything has become so badly fast.. coming soon. need to cleanu and prepare a good presentation cause i wanna change the APIs. |
While working on #604 the fragmentation of Colors (modm::ui::color and modm::glcd::Color) forced me to this PR.
Key changes
glcd::Color::black()
,glcd::Color::white()
a.s.o.color_display.setColor(color::Rgb(255, 0, 0))
orcolor_display.setColor(color::Hsv(0, 100, 100))
to submit pure Red in Rgb565 format.setColor(Hsv color)
andfadeTo(Hsv color, uint16_t time)
has become rudimentary.Performance
Using conversion constructors is defacto more elegant. I've compared the compilates: No differences ...
color_display.setColor(color::Rgb565(0xF800))
color_display.setColor(color::Rgb(255, 0, 0))
color_display.setColor(color::Hsv(0, 100, 100))