Color coordination with CharImage colors

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #37940
    HeDiBo
    Participant

    I have a groupbox with a TsLabelFx and a couple of checkboxes. The checkboxes have custom images.

    I want the TsLabelFx to be color coordinated with the color of the checkboxes when they are checked.

    This project will show you what I mean.

    [attachment=8897:acColorCoordinated.zip]

    Initializing the Kind.Color of TsLabelFx to slBtnGreenText actually makes it Blue!!!

    What is the best approach here. I want to keep the color coordination in dark skins too.

    #58348
    Stephane Senecal
    Participant

    it seems to work that way.

    lfx.Kind.Color := $FFFFFF and slBtnGreenText;

    Stephane Senecal
    CIS Group
    Delphi programmer since 2001

    #58349
    HeDiBo
    Participant
    'Stephane wrote:

    it seems to work that way.

    lfx.Kind.Color := $FFFFFF and slBtnGreenText;

    Very nice, thank you.

    This solves one part of the problem. Now getting the color right for dark skins.

    #58356
    Support
    Keymaster

    Will be better to use the acColorToRGB function.

    slBtnGreenText is not RGB color, this color should be converted to the current skin color:

    Code:
    lfx.Kind.Color := acColorToRGB(slBtnGreenText);

    Uses sVCLUtils;

    #58358
    HeDiBo
    Participant
    'Support' wrote:

    Will be better to use the acColorToRGB function.

    slBtnGreenText is not RGB color, this color should be converted to the current skin color:

    Code:
    lfx.Kind.Color := acColorToRGB(slBtnGreenText);

    Uses sVCLUtils;

    That's great!

    Now can you repair the missing OnAfterChange and OnActivate events. They are not fired if the application starts.

    Also OnDeactivate is not fired when the application closes.

    #58359
    Support
    Keymaster

    OnAfterChange event should be fired when changed one activated skin to another.

    OnActivate and OnDeactivate will work in the v14.01 as expected.

    #58361
    Stephane Senecal
    Participant

    Much better!

    I was looking for something like this, but I couldn't find it.

    Thank you

    'Support' wrote:

    Will be better to use the acColorToRGB function.

    slBtnGreenText is not RGB color, this color should be converted to the current skin color:

    Code:
    lfx.Kind.Color := acColorToRGB(slBtnGreenText);

    Uses sVCLUtils;

    Stephane Senecal
    CIS Group
    Delphi programmer since 2001

    #58362
    Support
    Keymaster

    This function works with standard colors like clWindow, clBtnFace and others (returns color from the current skin).

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.