Lazarus

Programming => Graphics and Multimedia => Graphics => Topic started by: Username on May 26, 2022, 04:01:08 am

Title: Where is GraphUtils? ColorToHLS?
Post by: Username on May 26, 2022, 04:01:08 am
Hi,
I want to have user settable color for a Panel that contains some controls and text, and I want to lighten the text if need be, based on the luminance value of the color so it is always easily seen.

I came across a couple posts, one of which refers to GraphUtils (ColorToHLS, RGBToHLS, HLSToColor, HLSToRGB) and it seems that what I want is ColorToHLS(), but I can find little to no information on it, and I can't find GraphUtil in the Laz IDE online package Manager at all.
 
Does it still exist? If so, how can I find it please?
TIA
Title: Re: Where is GraphUtils? ColorToHLS?
Post by: Handoko on May 26, 2022, 04:42:13 am
... I can't find GraphUtil in the Laz IDE online package Manager at all.

You just need to put GraphUtil in the uses clause, it is provided by LCL.
Title: Re: Where is GraphUtils? ColorToHLS?
Post by: Username on May 26, 2022, 04:48:39 am
... I can't find GraphUtil in the Laz IDE online package Manager at all.

You just need to put GraphUtil in the uses clause, it is provided by LCL.
Thanks Handoko! It was just misspelled! Had uses GraphUtils not GraphUtil.
Title: Re: Where is GraphUtils? ColorToHLS?
Post by: wp on May 26, 2022, 09:45:31 am
I have the same issue with these XXXUtil(s) units from time to time. My solution: Type the unit name without "s" first, move the mouse over it and press the CTRL key. When the unit name becomes blue and underlined the IDE found it. Otherwise add the "s", and try again with the mouse.
Title: Re: Where is GraphUtils? ColorToHLS?
Post by: rvk on May 26, 2022, 09:54:29 am
I have the same issue with these XXXUtil(s) units from time to time. My solution: Type the unit name without "s" first, move the mouse over it and press the CTRL key. When the unit name becomes blue and underlined the IDE found it. Otherwise add the "s", and try again with the mouse.
Funny, never knew that about the CTRL+mouse.
I always use Alt + Up key. If the unit exists, it'll open up (CTRL+F4 to close it fast), otherwise you get an message in the message-pane.

Both also work for classes etc.

(Ctrl+Enter should also work for files/units)
TinyPortal © 2005-2018