Menu

Set custom color

2014-02-13
2014-02-14
  • Rob Kenders

    Rob Kenders - 2014-02-13

    Hi Babak,

    Could you explain to me how i can set a custom
    color to a component ? This doesnt work for me
    and i get as result no color at all / transparent :

    var
    MyCol : TAlphacolor;
    begin
    // MyCol := StringToAlphaColor('$00353269');
    MyCol := $00353269;
    DPFButton1.BackgroundColorNormal := MyCol;
    end;

    Hope you can help me how to set a custom color :)

    Cheers,

    Rob

     
  • Roger Nyberg

    Roger Nyberg - 2014-02-14

    Hi Rob,

    one way
    DPFButton1.BackgroundColorNormal := TAlphaColor($FF000000) or MyCol;

    3 ways to set red,
    AlphaColorcRec.Red;
    TAlphaColor($FF000000) or TAlphaColor($FF0000);
    TAlphaColor($FFFF0000);

    /Roger

     
  • Rob Kenders

    Rob Kenders - 2014-02-14

    Hi Roger,

    Thanks for your reply.

    When i use this, i get black ? :

    DPFButton1.BackgroundColorNormal := TAlphaColor($FF000000);

    And when using a "Blue-ish" color i get a transparent button :

    DPFButton1.BackgroundColorNormal := TAlphaColor($00353267);

    Is this only me ?

    Could you check if you get normal color Red with first and
    blue-ish with second ?

    No clue what's going on :)

    Cheers,

    Rob

     
  • Babak Yaghoobi

    Babak Yaghoobi - 2014-02-14

    Hi Rob

    Use :

    DPFButton1.BackgroundColorNormal := TAlphaColor($FF353267);
    

    Regards

     

    Last edit: Babak Yaghoobi 2014-02-14
  • Rob Kenders

    Rob Kenders - 2014-02-14

    Works :D

    Thanks Babak !

    Cheers,

    Rob

     
  • Roger Nyberg

    Roger Nyberg - 2014-02-14

    Thats where the mask come in

    DPFButton1.BackgroundColorNormal := TAlphaColor($FF353267);

    DPFButton1.BackgroundColorNormal := ( TAlphaColor($FF000000) or TAlphaColor($00353267) );

    Later,

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.