key.name = name.toLowerCase(); int pos = Arrays.binarySearch(colors, key); if (pos < 0) { return null; } return colors[pos].toColor();