Java tutorial
//package com.java2s; /* * Copyright (C) 2016 ?linson Santos Xavier <isoron@gmail.com> * * This file is part of Loop Habit Tracker. * * Loop Habit Tracker is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your * option) any later version. * * Loop Habit Tracker is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ import android.graphics.*; public class Main { public static int getAndroidTestColor(int index) { int palette[] = { Color.parseColor("#D32F2F"), // 0 red Color.parseColor("#E64A19"), // 1 orange Color.parseColor("#F9A825"), // 2 yellow Color.parseColor("#AFB42B"), // 3 light green Color.parseColor("#388E3C"), // 4 dark green Color.parseColor("#00897B"), // 5 teal Color.parseColor("#00ACC1"), // 6 cyan Color.parseColor("#039BE5"), // 7 blue Color.parseColor("#5E35B1"), // 8 deep purple Color.parseColor("#8E24AA"), // 9 purple Color.parseColor("#D81B60"), // 10 pink Color.parseColor("#303030"), // 11 dark grey Color.parseColor("#aaaaaa") // 12 light grey }; return palette[index]; } }