Back to project page unknown-pleasures.
The source code is released under:
Creative Commons Attribution NonCommercial NoDerivs (CC-NC-ND) THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTE...
If you think the Android project unknown-pleasures listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/** * Retro2Palette.java//from ww w . ja v a 2 s . co m * Author: marek.brodziak@gmail.com * Created: May 6, 2014 * Copyright 2014 by miniti */ package pl.miniti.android.pleasures.palette; import android.graphics.Color; /** * Retro colors on a black background */ public class Retro2Palette extends DimSupport { /** * Palette colors */ private static final int[] palette = new int[]{Color.rgb(76, 147, 133), Color.rgb(242, 209, 179), Color.rgb(242, 231, 126), Color.rgb(218, 118, 152), Color.rgb(227, 167, 192)}; /* * (non-Javadoc) * * @see pl.miniti.android.pleasures.palette.DimSupport#rgb(int, int) */ @Override protected int rgb(int line, int of) { return palette[(int) ((1f * line / of) * palette.length)]; } /* * (non-Javadoc) * * @see pl.miniti.android.pleasures.palette.Palette#background() */ @Override public int background() { return Color.BLACK; } /* * (non-Javadoc) * * @see pl.miniti.android.pleasures.palette.Palette#frame() */ @Override public void frame() { // do nothing } }