Color Values

A color value specifies an RGB value with an alpha channel, which can be used in various places such as specifying a solid color for a Drawable or the color to use for text. A color value always begins with a pound (#) character and then followed by the Alpha-Red-Green-Blue information in one of the following formats:

If you want to retrieve the color represented by a resource ID, you can call the Resources.getColor() method.

Source file format: XML file requiring a <?xml version="1.0" encoding="utf-8"?> declaration, and a root <resources> element containing one or more <color> tags.

Resource source file location: res/values/colors .xml (File name is arbitrary.)

Compiled resource datatype: Resource pointer to a Java int.

Resource reference name:

• XML: @[package :]color/some name (where some_name is the name of a specific color) Syntax

0 0

Post a comment