public @Nullable MaterialColor getByColor(Context context, int colorValue) { for (MaterialColor color : colors) { if (color.represents(context, colorValue)) { return color; } } return null; }