jeudi 14 mai 2015

Which color should i use for Toolbar and status from bitmap using the Pallate.Builder?

I see the new material design whatsup in which the status bar and the toolbar color changed from the profile picture.I want to implement that in my project so my code for generating the pallate is below.

        bitmap  = BitmapFactory.decodeResource(getApplication().getResources(),R.drawable.special_offer_banner);
    Palette.Builder abcd = Palette.from(bitmap);
    abcd.generate(new PaletteAsyncListener() {

        @Override
        public void onGenerated(Palette arg0) {
            // TODO Auto-generated method stub

            // TODO Auto-generated method stub
            /***
             * from below swatches which swatch should i use for statusbar and toolbar
             */


            palette.getDarkMutedSwatch();//Or arg0.getDarkMutedColor(Color.WHITE); color for respective swatch
            palette.getDarkVibrantSwatch();
            palette.getLightMutedSwatch();
            palette.getLightVibrantSwatch();
            palette.getMutedSwatch();


            //---------------------OR--------------------------//
            List<Swatch> listOfSwatches = palette.getSwatches();//get All swatchs from palette

            for (Iterator iterator = listOfSwatches.iterator(); iterator
                    .hasNext();) {
                Swatch swatch = (Swatch) iterator.next();

                /***
                 * from below colors swatches which color should i use for statusbar and toolbar
                 */
                swatch.getBodyTextColor();
                swatch.getPopulation();
                swatch.getTitleTextColor();
                swatch.getRgb();
                swatch.getHsl();
            }

        }
    });

From the above color/swatch which color/swatch should i use for status bar and toolbar?

Aucun commentaire:

Enregistrer un commentaire