例えば、sRGB の10進定数をフィールドに持つ Item があったとして、 public static int RED = Integer.parseInt("FF0000", 16); public static int GREEN = Integer.parseInt("00FF00", 16); public static int BLUE = Integer.parseInt("0000FF", 16); private record Item(int colorDec, String name) { } この Item を色別にグルーピングして map に格納する。 private…