Generation

generate functionSat, 12 Nov 2022

add a distinctive color for each number 0-7

public static Color getColor(int number) { switch(number) { case 0: return Color.White; case 1: return Color.Red; case 2: return Color.Green; case 3: return Color.Yellow; case 4: return Color.Orange; case 5: return Color.Blue; case 6: return Color.Magenta; case 7: return Color.Cyan; default: return Color.Black; } }

Questions about programming?Chat with your personal AI assistant