0

I am using Palette Library for picking dominant color. My swatch is giving right TitleTextColor but not giving RGB color. I am using rgb color to apply background of linear layout

Bitmap bitmap = BitmapCompress.decodeBitmapFromResource(getResources(), R.drawable.mihawk, 360, 360);
Palette p = Palette.from(bitmap).generate();
Palette.Swatch vibrantSwatch = p.getDominantSwatch();
LinearLayout top;
top = findViewById(R.id.wallpaperLinearLayoutTop);
top.setBackgroundColor(vibrantSwatch.getRgb());  

Here is Xml

    <LinearLayout
        android:id="@+id/wallpaperLinearLayoutTop"
        android:layout_width="match_parent"
        android:layout_height="64dp"
        android:alpha="0.85"
        android:orientation="horizontal">
user6556461
  • 377
  • 3
  • 14

0 Answers0