Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Color Mix2Colors(Color C1, Color C2)
- {
- int[] Colors = new int[] {C1.R,C2.R,C1.G,C2.G,C1.B,C2.B };
- return Color.FromArgb(Convert.ToInt32((Colors[0] + Colors[1]) / 2), Convert.ToInt32((Colors[2] + Colors[3]) / 2), Convert.ToInt32((Colors[4] + Colors[5]) / 2));
- }
- public static Color Mix3Colors(Color C1, Color C2, Color C3)
- {
- int[] Colors = new int[] {C1.R,C2.R,C3.R,C1.G,C2.G, C3.G,C1.B,C2.B,C3.B };
- return Color.FromArgb(Convert.ToInt32((Colors[0] + Colors[1] + Colors[2]) / 3), Convert.ToInt32((Colors[3] + Colors[4] + Colors[5]) / 3), Convert.ToInt32((Colors[6] + Colors[7] + Colors[8]) / 3));
- }
- public static Color Mix4Colors(Color C1, Color C2, Color C3, Color C4)
- {
- int[] Colors = new int[] {C1.R,C2.R,C3.R,C4.R,C1.G,C2.G,C3.G,C4.G,C1.B,C2.B,C3.B,C4.B};
- return Color.FromArgb(Convert.ToInt32((Colors[0] + Colors[1] + Colors[2] + Colors[3]) / 4), Convert.ToInt32((Colors[4] + Colors[5] + Colors[6] + Colors[7]) / 4), Convert.ToInt32((Colors[8] + Colors[9] + Colors[10] + Colors[11]) / 4));
- }
Advertisement
Add Comment
Please, Sign In to add comment