WPCubed Product Support

Font Colours not correct

wpsupport

I found the reson for this problem -

Please paste this function right at the start of implementation in
unit WPIOHTML and it should work:

function WPColorToString(Color: TColor): string;
var
rgb : Cardinal;
begin
if Color = clNone then Result:='transparent'
else
begin
rgb := ColorToRGB(Color);
Result := Format('#%.2x%.2x%.2x',
[GetRValue(rgb), GetGValue(rgb), GetBValue(rgb)]);
end;
end;

#4 ♥ 0
670 Views 2 users read 2 min

We have updated to the latest version with the issue remaining.

#3 ♥ 0

Is there any update to this? Its quite a big issue for our customers so would like to find out if there is a known issue or not.

#2 ♥ 0

Hi,

When saving TWRichText content to HTML, any text formatted as red or yellow is being converted to blue. For example, using MyText.SaveToFile('c:\myText.html', False, 'HTML'); produces incorrect colours. Has anything changed in recent versions? We upgraded to v9.4.2.0 recently, and earlier versions did not show this behaviour.

The HTML page source is below:

--></style></head><body>
<div class="emptypar">&nbsp;</div>
<div class="emptypar">&nbsp;</div>
<div><span style="color:Blue;font-family:'Calibri';font-size:11.00pt;">red</span></div>
<div><span style="color:Aqua;font-family:'Calibri';font-size:11.00pt;">yellow</span></div>
<div><span style="color:#00FF00;font-family:'Calibri';font-size:11.00pt;">green</span></div>
<div><span style="color:#0000FF;font-family:'Calibri';font-size:11.00pt;">blue</span></div>
<div><span style="font-family:'Calibri';font-size:11.00pt;">black</span></div>
</body></html>

We are using the WPToolbar along with WPRichText.

#1 ♥ 0