Hello!
I couldn't find a function that converts a #RRGGBB color to TFPColor in
FPC sources. I only found HTMLToFPColor in Lazarus
/trunk/components/tachart/tahtml.pas
IMO it is a fairly general function and should be in FPC sources. What
do you FPC developers think?
Ondrej
___
On Sun, 23 Jul 2017, Ondrej Pokorny wrote:
Hello!
I couldn't find a function that converts a #RRGGBB color to TFPColor in
FPC sources. I only found HTMLToFPColor in Lazarus
/trunk/components/tachart/tahtml.pas
IMO it is a fairly general function and should be in FPC sources. What
do you
On 23.07.2017 12:51, Michael Van Canneyt wrote:
Agreed. Feel free to submit a patch.
Great, I will!
Ondrej
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
On 7/23/17, Ondrej Pokorny wrote:
> Great, I will!
My try ...
{ Try to translate HTML color code into TFPColor
Supports following formats
'#rgb'
'#rrggbb'
W3C Html color name
}
function TryHtmlToFPColorDef(const S: String; out FPColor: TFPColor;
Def: TFPColor): Boolean;
functio
On 7/23/17, Bart wrote:
> My try ...
Forget previous post...
This should make more sense.
resourcestring
SInvalidHtmlColor = '"%s" is not a valid Html color';
{ Try to translate HTML color code into TFPColor
Supports following formats
'#rgb'
'#rrggbb'
W3C Html color name
}
fu
Hi,
Can you refactor the huge case to use a local proc?
it hurts my eyes...
Michael.
On Sun, 23 Jul 2017, Bart wrote:
On 7/23/17, Bart wrote:
My try ...
Forget previous post...
This should make more sense.
resourcestring
SInvalidHtmlColor = '"%s" is not a valid Html color';
{ Try
On 7/23/17, Michael Van Canneyt wrote:
> Can you refactor the huge case to use a local proc?
> it hurts my eyes...
Yes I can.
But obviously it will keep hurting your eyes, but just in a different
place in the sourcecode?
Bart
___
fpc-devel maillist -
On Sun, 23 Jul 2017, Bart wrote:
On 7/23/17, Michael Van Canneyt wrote:
Can you refactor the huge case to use a local proc?
it hurts my eyes...
Yes I can.
But obviously it will keep hurting your eyes, but just in a different
place in the sourcecode?
I meant something like:
Procedur
On 7/23/17, Bart wrote:
Hopefully less eye-sorrow ...
resourcestring
SInvalidHtmlColor = '"%s" is not a valid Html color';
type
THtmlColorName = (
hcnWhite, hcnSilver, hcnGray, hcnBlack,
hcnRed, hcnMaroon, hcnYellow, hcnOlive,
hcnLime, hcnGreen, hcnAqua, hcnTeal, hcnBlue,
h
On 23.07.2017 14:39, Bart wrote:
{ Try to translate HTML color code into TFPColor
Supports following formats
'#rgb'
'#rrggbb'
W3C Html color name
}
function TryHtmlToFPColorDef(const S: String; out FPColor: TFPColor;
Def: TFPColor): Boolean;
Actually I wanted to use an advance
On 7/23/17, Ondrej Pokorny wrote:
> +Btw. there are much more name constants:
> https://www.w3schools.com/colors/colors_names.asp
My set is W3C compliant ...
Bart
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cg
On 23.07.2017 15:50, Bart wrote:
On 7/23/17, Ondrej Pokorny wrote:
+Btw. there are much more name constants:
https://www.w3schools.com/colors/colors_names.asp
My set is W3C compliant ...
Ah, I see you use only the W3C basic colors
https://www.w3.org/wiki/CSS/Properties/color/keywords
It'
On 7/23/17, Ondrej Pokorny wrote:
> Ah, I see you use only the W3C basic colors
> https://www.w3.org/wiki/CSS/Properties/color/keywords
https://www.w3.org/TR/css3-color/#colorunits
Actually, adding more colornames is fine with me, itś just a tedious job ...
Bart
___
On 23.07.2017 15:25, Michael Van Canneyt wrote:
I think the case statement is inefficient enough not to worry about an
additional call.
There is IdentToInt function in Classes that makes this more efficient.
IdentToColor from Graphics.pas uses it as well.
Ondrej
_
On 23.07.2017 16:08, Ondrej Pokorny wrote:
On 23.07.2017 15:25, Michael Van Canneyt wrote:
I think the case statement is inefficient enough not to worry about
an additional call.
There is IdentToInt function in Classes that makes this more
efficient. IdentToColor from Graphics.pas uses it as
How about this. To me it is more readable.
type
THtmlColorName = (
*hcnUnknown*, hcnWhite, hcnSilver, hcnGray, hcnBlack,
hcnRed, hcnMaroon, hcnYellow, hcnOlive,
hcnLime, hcnGreen, hcnAqua, hcnTeal, hcnBlue,
hcnNavy, hcnFuchsia, hcnPurple);
function TryStrToHtmlColorName(const S: St
On 7/23/17, ListMember wrote:
> How about this. To me it is more readable.
>
> type
>THtmlColorName = (
> *hcnUnknown*, hcnWhite, hcnSilver, hcnGray, hcnBlack,
I dismissed that idea, becuase now you would have to have an entry in
HtmlColorNameToFPColorMap for hcnUnknown, which makes no sense
On Sun, 23 Jul 2017, Bart wrote:
On 7/23/17, ListMember wrote:
How about this. To me it is more readable.
type
THtmlColorName = (
*hcnUnknown*, hcnWhite, hcnSilver, hcnGray, hcnBlack,
I dismissed that idea, becuase now you would have to have an entry in
HtmlColorNameToFPColorMap for h
El 23/07/2017 a las 16:05, Bart escribió:
https://www.w3.org/TR/css3-color/#colorunits
Actually, adding more colornames is fine with me, itś just a tedious job ...
Hello,
If somebody needs it:
type
HTMLStandardColor=record
ColorName: string;
Red: BYTE;
Green: BYTE;
Blue: B
On 23.07.2017 16:42, Michael Van Canneyt wrote:
Inserted this version, without the hcnUnknown. fpimage unit, rev. 36774.
Thank you Bart & Michael! I am building FPC trunk right now :)
Ondrej
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
h
On 7/23/17, Ondrej Pokorny wrote:
> Thank you Bart & Michael! I am building FPC trunk right now :)
My pleasure.
It was on my private ToDo list anyway.
Bart
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/m
Another, related topic would be: Replacement of HTML entities, e.g.
convert a string such as 'cm2' to
'cm2', or 'sin α + cos β' to the one with the
correct greek symbols (utf8). I have a solution in TAChart, unit TAHtml,
but maybe (probably...) there's a better one.
___
On Sun, 23 Jul 2017, Werner Pamler wrote:
Another, related topic would be: Replacement of HTML entities, e.g.
convert a string such as 'cm2' to
'cm2', or 'sin α + cos β' to the one with the
correct greek symbols (utf8). I have a solution in TAChart, unit TAHtml,
but maybe (proba
Am 23.07.2017 um 18:09 schrieb Michael Van Canneyt:
This exists:
function ResolveHTMLEntityReference(const Name: WideString; var
Entity: WideChar): Boolean;
is in unit htmldefs, fcl-xml package.
Thank you. Seeking more carefully would have saved me a lot of tedious
typing... Replaced my o
On Sun, 23 Jul 2017, Werner Pamler wrote:
Am 23.07.2017 um 18:09 schrieb Michael Van Canneyt:
This exists:
function ResolveHTMLEntityReference(const Name: WideString; var
Entity: WideChar): Boolean;
is in unit htmldefs, fcl-xml package.
Thank you. Seeking more carefully would have save
25 matches
Mail list logo