Android colors.xml
To express color in layout, we have to write #xxxxxx style.
Also, have to write color code using Color.
To use colors.xml, we can use alias and can use it in code and layout xml.
We can set common name in color.xml.
colors.xml
You should create colors.xml under res directory.
Example
colors.xml
<?xml version="1.0" encoding="utf-8"?> <resources> <item name="white" type="color">#FFFFFFFF</item> </resources>
layout
android:background="@color/white"