Hong
Hong

Reputation: 18531

<ImageButton>: Insufficient image color contrast ratio

I am having difficulty making the warning "ImageButton: Insufficient image color contrast ratio" disappear.

<androidx.appcompat.widget.LinearLayoutCompat
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@color/black">
    <ImageButton
        android:id="@+id/debug"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:contentDescription="debug"
        android:src="@drawable/baseline_check_24"
        tools:ignore="HardcodedText" />
</androidx.appcompat.widget.LinearLayoutCompat>

baseline_check_24.xml:

<path android:fillColor="@android:color/white" android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"/>

I get "debug : Insufficient image color contrast ratio" from Android Studio. The annotation:

*Insufficient image color contrast ratio

The image's contrast ratio is 1.12. This ratio is based on an estimated foreground color of #121212 and an estimated background color of #000000. Consider increasing this ratio to 3.00 or greater. This item may be obscured by other on-screen content. Consider manually testing this item's contrast.*

Could anyone shed some light on this?

Upvotes: 0

Views: 120

Answers (0)

Related Questions