For example, if I set the background color to be #FF0000, I expect a bright red. However, I’m getting a dark red. If I set the background to #FFFFFF, I get gray instead of white.
I noticed that if I switch the theme for the application from dark to light, then all of the colors start showing up lighter than what I expect, so red goes to a washed out red, and black goes to gray.
Does anyone have any idea why this is happening?
More info: here’s my layout:
(I’m trying to change the background of the TextView from black to white when it’s clicked.)
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ListView android:id="@+id/wordList"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1.0" />
<TextView android:id="@+id/addButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:textSize="20sp"
android:textStyle="bold"
android:gravity="center_horizontal"
android:background="@color/black"
android:text="@string/add_button"
android:textColor="@color/white"
android:clickable="true"/>
</LinearLayout>
You are missing the alpha channel. The colors are in the format #AARRGGBB where AA is the transparency. For bright opaque red you should try #FFFF0000.