<div dir="ltr"><img width="0" height="0" class="mailtrack-img" alt="" style="display:flex" src="https://mailtrack.io/trace/mail/73c7df6b07ed58cc67f6ce0030750168e857642e.png?u=1477559"><div></div><div class="gmail_extra"><div class="gmail_quote"><div>Hello everyone,</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Basically, annotation color is set as a common attribute to all annotation<br>
types at the end of the file and if we should bypass it with an if<br>
condition that will set annotation color for type "typewriter" hardcoded to<br>
QColor(255,255,255,0).<br>
I have tried harcoding it for inline note and in the appearance settings, I<br>
got a transparent color but as soon as I create a note, it's background<br>
turns to white. and I find color: white in the appearance settings again.<br>
Will it work for the typewriter then?<br>
</blockquote>
<br></span>
No, if it doesn't work for inline note it also won't work for typewriter. We have seen transparent background working in our Qt5 poppler demo <a href="https://cgit.kde.org/scratch/dileepsankhla/okular-gsoc2018-typewriter.git/tree/src/main.cpp#n24" rel="noreferrer" target="_blank">https://cgit.kde.org/scratch/d<wbr>ileepsankhla/okular-gsoc2018-t<wbr>ypewriter.git/tree/src/main.cp<wbr>p#n24</a>. So the alpha channel obviously gets lost somewhere inside Okular. Can you try to hunt the QColor down the stack and see where this happens?</blockquote><div>The culprit is here: Okular::Annotation::store in core/annotations.cpp L753.</div><div><br></div><div><div>if ( d->m_style.color().isValid() )</div><div> e.setAttribute( QStringLiteral("color"), d->m_style.color().name() );</div></div><div><br></div><div>Here QColor::name converts our QColor(255,255,255,0) to #ffffff (white) and we loose the alpha value. We can thus use:</div><div><br></div><div>e.setAttribute( QStringLiteral("color"), d->m_style.color().name(QColor::HexArgb) );<br></div><div><br></div><div>QColor::HexArgb gives color name in #AARRGGBB format and hence we get our color hex value as #00ffffff which tells that alpha channel is 0. </div><div><br></div><div>This is consistent with all other color values too and I will implement it in my patch.</div><div><br></div><div>Thanks and Regards</div><div>Dileep</div><div> </div></div><br></div></div>