[Lazarus] ColotToRGB in GTK apps

Valdas Jankūnas skroblas at erdves.lt
Sat Jul 26 23:34:00 CEST 2008


Mattias Gaertner rašė:
> On Sat, 26 Jul 2008 21:55:03 +0300
> Valdas Jankūnas <skroblas at erdves.lt> wrote:
> 
>> Hello,
>>
>>   i trying get R G B values of system color "clBackground" (and
>> others). So i use ColorToRGB function (app compiled with gtk2 widget
>> set), but I get values that differs from actual color of form face. I
>> found that these values match to values defined in unit "GTKGlobals"
>> in array "SysColorMap". Is this function not yet implemented or this
>> is a bug?
>>
>> Lazarus svn 15819; fpc 2.2.0 i386; Linux i386 Kubuntu 8.04
> 
> These constants depend on widget class and user theme. For example a
> button has a different background than a form. And many themes use
> images or gradients or transparency and do not define a default color.
> I don't know what you are trying to achieve, but maybe you can use the
> functions of the lcl themes unit.

  My goal is button with duotone glyph: i load grayscale glyph from 
resources, then change glyph colors from clBackground (white in source 
glyph) to clWindowText (black in source glyph), and then transfer 
modified image in to button glyph. So, if I want calculate color 
transition then I must have RGB values of clBackground and clWindowText.
  In Windoze this works well, but in Linux one day I noticed that colors 
are not correct.
  I know only this way, but maybe is another (alpha channel?)?

  Thanks, I take look at "themes.pas".

-- 
   Valdas Jankūnas



More information about the Lazarus mailing list