Returns an array of the color Strings in the argument(s) and the 13 predefined color names "Red", "Green", ... "Pink". The Strings arguments must be either "None" or hex codes starting with "#". Any null arguments are ignored.
(String... moreColors)
| 270 | * The Strings arguments must be either "None" or hex codes starting with "#". |
| 271 | * Any null arguments are ignored. */ |
| 272 | public static String[] getColors(String... moreColors) { |
| 273 | ArrayList names = new ArrayList(); |
| 274 | for (String arg: moreColors) { |
| 275 | if (arg!=null && arg.length()>0 && (!Character.isLetter(arg.charAt(0))||arg.equals("None"))) |
| 276 | names.add(arg); |
| 277 | } |
| 278 | for (String arg: colors2) |
| 279 | names.add(arg); |
| 280 | return (String[])names.toArray(new String[names.size()]); |
| 281 | } |
| 282 | |
| 283 | /** Converts a wavelength (380-750 nm) to color. |
| 284 | * Based on the wavelength_to_rgb.R program at |
no test coverage detected