So it is pretty simple..
just
Step1 . Create color.xml under res/values in you android project
with color name and color code
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="Red">#E41B17</color>
<color name="Blue">#A5D4FE</color>
<color name="Purple">#9172EC</color>
</resources>
Step 2 . Now in your activity
txRed.setTextColor(getResources().getColor(R.color.Red));
txBlue.setTextColor(getResources().getColor(R.color.Blue));
txPurple.setTextColor(getResources().getColor(R.color.Purple));
just
Step1 . Create color.xml under res/values in you android project
with color name and color code
<resources>
<color name="Red">#E41B17</color>
<color name="Blue">#A5D4FE</color>
<color name="Purple">#9172EC</color>
</resources>
Step 2 . Now in your activity
txRed.setTextColor(getResources().getColor(R.color.Red));
txBlue.setTextColor(getResources().getColor(R.color.Blue));
txPurple.setTextColor(getResources().getColor(R.color.Purple));