You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
637 B
28 lines
637 B
|
|
using Godot; |
|
|
|
public static class Helper |
|
{ |
|
public static Color[] myColors = new[] |
|
{ |
|
Colors.Red, Colors.Blue, Colors.Green, Colors.Yellow, Colors.Purple, Colors.Orange, Colors.Indigo, Colors.White |
|
}; |
|
|
|
public static Color[] MakeColorArray(int vertexCount, int verticePerColor) |
|
{ |
|
Color[] vertices = new Color[vertexCount]; |
|
int ci = -1; |
|
for (int i = 0; i < vertexCount; i++) |
|
{ |
|
if (i % verticePerColor == 0) |
|
{ |
|
ci++; |
|
} |
|
|
|
vertices[i] = myColors[ci % myColors.Length]; |
|
} |
|
return vertices; |
|
} |
|
|
|
|
|
} |