Form color

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #32902
    Tom
    Participant

    Hello

    How can I get the color of the mainform, i.e. skin form color?

    regards
    Tom

    #38902
    shadow_tj
    Participant

    what do you want the skinned mainform color for ??

    if you want to paint a panel with the same color of the mainform..
    replace the TPanel with a TsPanel ( GeExprts tools are very usefull for that )

    The sPanel has a Skindata property.. when the panels are dropped on a form.. yust make the SkinSection on “NONE”
    then the panel will be transparent so you see the Form colors.

    You can also set the skinsection to form, but must of the time you get the form color with a border.

    Other options is to create a own SkinSection, where you only select the form background colors.
    There are tools on the Alphaskin page to adjust the skins.
    But must easiest way is to use SkinSection “None”

    Or is there a other thing you want the Form color ??

    #38904
    Tom
    Participant

    QUOTE (shadow_tj @ Apr 29 2009, 08:07 AM)
    what do you want the skinned mainform color for ??

    if you want to paint a panel with the same color of the mainform..
    replace the TPanel with a TsPanel ( GeExprts tools are very usefull for that )

    The sPanel has a Skindata property.. when the panels are dropped on a form.. yust make the SkinSection on “NONE”
    then the panel will be transparent so you see the Form colors.

    You can also set the skinsection to form, but must of the time you get the form color with a border.

    Other options is to create a own SkinSection, where you only select the form background colors.
    There are tools on the Alphaskin page to adjust the skins.
    But must easiest way is to use SkinSection “None”

    Or is there a other thing you want the Form color ??

    I'm using a 3D rendering component to display some objects (images with reflection, coverflow style). This component has a background color property, and I would like to set this to the same color as background color of current skin. My application has the possibility to change skin, hence the request.

    #38917
    Support
    Keymaster

    Hello

    You can use sSkinManager1.GetGlobalColor function.
    Here you will have received a global color of current skin. But form may be textured or filled by gradient. If you want to receive an all info about background please write again and I'll help you.

    #38940
    Tom
    Participant

    QUOTE (Support @ Apr 30 2009, 05:35 AM)
    Hello

    You can use sSkinManager1.GetGlobalColor function.
    Here you will have received a global color of current skin. But form may be textured or filled by gradient. If you want to receive an all info about background please write again and I'll help you.

    Thanks, will have a look at it

    I also think the following code might work:

    CODE
    var
    R, G, B: Cardinal;

    begin
    PixelCol := GetPixel(GetDC(0), screen.width -2, screen.height -2);
    R := GetRValue(PixelCol);
    G := GetGValue(PixelCol);
    B := GetBValue(PixelCol);
    form1.gui.color:= B Shl 16 Or G Shl 8 Or R;
    end;

    I'll feed back later…

    #38959
    shadow_tj
    Participant

    that option may work if you got a solid color with no textures in it.
    so when the background has only 1 color.

    But when you have that, and you only use the same skin why not grab the color combination when you run your application.
    there are tools to grab colors from applications.

    The application i used most for getting the right color is ColorCop.

    URL: http://colorcop.net/

    with this tool you get a pipet to grabcolor settings from other applications.
    this way you can grab the color you need and yust use that in the color property.

    Your way also works, except when you add a other item on position 2,2 this is very close on the position of Menu`s.
    so when you add a menu to your application you will get a other color.

    greetings,

    shadow_tj

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