The way to do this with Android is to define the attribute to be styled in /res/values/attrs.xml, then define the attribute for each them (TextSecure.Light and .Dark) in /res/values/themes.xml.  Then reference that attribute in the code.  You can look at what's there for some examples of how it works in practice.