Java examples for 2D Graphics:Color
get Nice Colors
/*// w ww.j a v a 2 s. c o m Storybook: Scene-based software for novelists and authors. Copyright (C) 2008 - 2011 Martin Mustun This program 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. This program 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/>. */ //package com.java2s; import java.awt.Color; public class Main { public static void main(String[] argv) throws Exception { System.out.println(java.util.Arrays.toString(getNiceColors())); } private static int[] colorValues = { 0xFFDAB9, // PeachPuff 0xBCD2EE, // LightSteelBlue2 0x2F4F4F, // DarkSlateGray 0xBEBEBE, // Grey 0x828282, // grey51 0x000080, // NavyBlue 0x6495ED, // CornflowerBlue 0x5F9EA0, // CadetBlue 0x90EE90, // PaleGreen2 0xFFD700, // Gold 0xDEB887, // Burlywood 0xF4A460, // SandyBrown 0xDA70D6, // Orchid 0x8A2BE2, // BlueViolet 0xAEEEEE, // PaleTurquoise2 0xEEB4B4, // RosyBrown2 0xFFA500, // Orange 0x6B8E23, // OliveDrab 0xFF1493, // DeepPink 0xFFFF00 // Yellow }; public static Color[] getNiceColors() { Color[] colors = new Color[colorValues.length]; for (int i = 0; i < colorValues.length; ++i) { colors[i] = new Color(colorValues[i]); } return colors; } }