I want to change some button colors globally in my code. I cannot seem to fine a way to define a color variable and then assign a color value to that variable.
I tried this Color SelectedColor = new Color();
f1.setBackgroundColor(Color.rgb(0, 0, 100));
I want to use ColorSelected in place of the RGB value so I can edit the value at start up.
f1.setBackgroundColor(Color.ColorSelected);
With Color Variables, you can set colors that synchronize across your document. When you make changes to a Color Variable, those changes appear across all of the layers that use it. You can create Color Variables that are local to a specific document or share them in a Library to use in other designs.
Click New —> Values resource file menu item to popup the New Resource File dialog window. In the New Resource File dialog window, input keyword colors in the File name input box, select main in the Source set drop-down list, input values in the Directory name input text box, then click the OK button. Then colors.
then you need to look in android. jar >> android >> R. class >> R >> color . This should be higher up on the list.
you can use values/colors.xml
. For instance
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="menu_background">#666666</color> </resources>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With