acbarbosa1964 / thtmlviewer

Automatically exported from code.google.com/p/thtmlviewer
Other
0 stars 2 forks source link

Implement RGBA and HSLA color values #274

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
CSS properties containing color values currently don't allow to specify 
semi-transparent colors via rgba()[1] and hsla()[2].

Which steps will reproduce the problem?
Open the test case.

What is the expected output? What do you see instead?
The first three <div>s should have a semi-transparent background color, the 
fourth a semi-transparent text and the fifth a semi-transparent border. I.e. 
they all should be displayed in some aqua tone. See the attached screenshot.

Which version of the product are you using? Which compiler version are you 
using? On which operating system?
r430, Delphi XE, Windows 7

Sebastian

[1] http://www.w3.org/TR/css3-color/#rgba-color
[2] http://www.w3.org/TR/css3-color/#hsla-color

Original issue reported on code.google.com by sebastia...@gmail.com on 31 Jul 2013 at 9:09

Attachments:

GoogleCodeExporter commented 9 years ago
I have actually looked at that issue some time ago.  I had experimented with 
the AlphaBlend Wom32 API function and I had made some progress but I wasn't 
satisfied with it.  The problem as I see it is this:

1) Most of the VCL and most Win32 API functions use the high color bits (13-16) 
for something other than alpha value.
2) Some internal THtmlViewer functionality might need to be restructured to 
accomodate ALpha blending opacity.  That's an additional byte that would have 
to propagate like everything else in the various HTMLViewer internals.
3) You have to create a separate bitmap that you draw text and graphics on and 
than superimpose that onto your main canvas.  See:

http://www.delphi-central.com/tutorials/AlphaBlend.aspx

4) I eventually came to a conclusion that it might be easier to simply use the 
GDI+ functions.  Newer versions of Delphi include headers for this but older 
ones would have to use the GDIPL2A unit and that is extremely limited in my 
opinion.
5) Using the GDIPlus would change the code quite a major manner.

I'm not dismissing this idea but I think it requires a good deal of thought.  
What I ahve so far with Alphablending is in the AlphaBlendUn unit if you wish 
to examine it.  Maybe I might be missing something.

Original comment by jpmug...@suddenlink.net on 2 Aug 2013 at 9:10

GoogleCodeExporter commented 9 years ago

Original comment by OrphanCat on 21 Aug 2013 at 9:19