<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 23.07.2017 14:39, Bart wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAMye31wssxndLgCUNJEkm-M0D7ntcmWpvXRq+Qumuhj-5euE_g@mail.gmail.com">{
Try to translate HTML color code into TFPColor
<pre wrap=""> Supports following formats
'#rgb'
'#rrggbb'
W3C Html color name
}
function TryHtmlToFPColorDef(const S: String; out FPColor: TFPColor;
Def: TFPColor): Boolean;</pre>
</blockquote>
<br>
Actually I wanted to use an advanced record for this (the other
functions are from the same unit):<br>
<br>
TFPColor = record<br>
red,green,blue,alpha : word;<br>
public<br>
<b>constructor CreateFromHTML(const HTML: string;
AllowConstantNames: Boolean);</b><br>
constructor Create(r,g,b,a:word);<br>
constructor Create(r,g,b:word);<br>
<br>
function AlphaBlend (color2: TFPColor): TFPColor;<br>
function CalculateGray : word;<br>
end;<br>
<br>
Michael, is such refactoring wanted? (Of couse I'll keep the old
normal functions as well.)<br>
<br>
+Btw. there are much more name constants:
<a class="moz-txt-link-freetext" href="https://www.w3schools.com/colors/colors_names.asp">https://www.w3schools.com/colors/colors_names.asp</a><br>
<br>
Ondrej<br>
</body>
</html>