erich.wanker Posted September 20, 2018 Share Posted September 20, 2018 hy .. At designtime, i give x-mask a random color: Quote UniHTMLFrame1.HTML.Append (' .x-mask {'); UniHTMLFrame1.HTML.Append (' background-image: none;'); zufall1:=inttostr(random(255)); zufall2:=inttostr(random(255)); zufall3:=inttostr(random(255)); UniHTMLFrame1.HTML.Append (' background-color: rgba('+zufall1+','+zufall2+','+zufall3+', 0.8) !important; '); UniHTMLFrame1.HTML.Append ('}'); .. different UniContainerPanel´s have the class x-mask .. and if i start the UniGUI App - the UniContainerPanels have a random color... But how can i change the color-value OF THE CSS at runtime with a UniColorButton? ... I ThanX Erich Link to comment Share on other sites More sharing options...
Sherzod Posted September 20, 2018 Share Posted September 20, 2018 Hi, Sorry, why and when do you need to change the color of x-mask ? Link to comment Share on other sites More sharing options...
erich.wanker Posted September 20, 2018 Author Share Posted September 20, 2018 ui_design.webm ok .. got it :-) but i think - i use a crazy way ;-) .. but it works Quote procedure TMainForm.UniColorButton1Select(Sender: TObject; Color: TColor); var r,g,b:Integer; farbe : LongInt; begin my_background_color:=Color; farbe := ColorToRGB(Color); R := GetRValue(farbe); G := GetGValue(farbe); B := GetBValue(farbe); my_background_color_string:='rgba('+inttostr(r)+','+inttostr(g)+','+inttostr(b)+',1)'; UniHTMLFrame5.HTML.Clear; UniHTMLFrame5.HTML.Append ('<style type="text/css"> '); UniHTMLFrame5.HTML.Append (' .x-mask {'); UniHTMLFrame5.HTML.Append (' background-color: rgba('+inttostr(r)+','+inttostr(g)+','+inttostr(b)+',0.6) !important; '); UniHTMLFrame5.HTML.Append ('}'); ... and so on Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now