Conversation
Support for #RGB is claimed in docs.
It's unlikely that string_to_color() is faster, but at least is more flexible. Not sure if 8-digit per channel format is used.
Codecov Report
@@ Coverage Diff @@
## master #717 +/- ##
==========================================
- Coverage 65.91% 65.74% -0.17%
==========================================
Files 29 29
Lines 5102 5115 +13
==========================================
Hits 3363 3363
- Misses 1739 1752 +13
Continue to review full report at Codecov.
|
|
The comment I posed in #713 still applies here. I don't see a reason to support so many different formats. #RRGGBBAA is widely used and and I don't think adding more provides any sort of useful functionality. In fact, the opposite, it unnecessarily increases code complexity and adds more things that may break without anyone realising. 'Less is more' as they say. The docs indeed did claim #RGB support, but given that no-one has complained thus far that it doesn't work, my reaction would be to fix the docs rather than implement it. |
Probably I was too precatious, not relying to common rule about unsigned subtraction to minus.
|
Hm, let assume FP format and hex string generic parsers are too complex. I could undo back to |
|
ping? At least one (my) vote for #RGB/#RGBA hex code support :) |
tsipinakis
left a comment
There was a problem hiding this comment.
Excuse the delay.
I could undo back to switch(len) variant.
That's what I had in mind. After thinking it over I'm fine with merging #RGB support given it requires minimal changes to the parsing.
However the other variant was too long and complex in my opinion which is why I said better to keep it simple.
All in all, LGTM!
Besides core rgba support I tried to implement support for arbitrary hex color string length (though limited by maximum unsigned length for given machine), as well as rgba() and rgb() formats, using scanf.
What's also interesting, adjacent non-overlaping areas are better to be combined in additive mode, so that fading out pixels at bounds mix correctly. I'm not sure though, if cairo uses alpha channel correctly (must be summed too, not like how it does with multiply op), but at least it removes artifacts between frame and background, visible when both are equally contrast with background.
Btw, imho colors are better to be parsed once on theme loading instead of on each draw().