Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetColor()

Color Terraria.Dust.GetColor ( Color newColor)
inline

Definition at line 2632 of file Dust.cs.

2633 {
2634 int num = type;
2635 if (num == 284)
2636 {
2637 return Color.Transparent;
2638 }
2639 int num2 = color.R - (255 - newColor.R);
2640 int num3 = color.G - (255 - newColor.G);
2641 int num4 = color.B - (255 - newColor.B);
2642 int num5 = color.A - (255 - newColor.A);
2643 if (num2 < 0)
2644 {
2645 num2 = 0;
2646 }
2647 if (num2 > 255)
2648 {
2649 num2 = 255;
2650 }
2651 if (num3 < 0)
2652 {
2653 num3 = 0;
2654 }
2655 if (num3 > 255)
2656 {
2657 num3 = 255;
2658 }
2659 if (num4 < 0)
2660 {
2661 num4 = 0;
2662 }
2663 if (num4 > 255)
2664 {
2665 num4 = 255;
2666 }
2667 if (num5 < 0)
2668 {
2669 num5 = 0;
2670 }
2671 if (num5 > 255)
2672 {
2673 num5 = 255;
2674 }
2675 return new Color(num2, num3, num4, num5);
2676 }
int type
Definition Dust.cs:38
static Color Transparent
Definition Color.cs:76

References Microsoft.Xna.Framework.Color.A, Microsoft.Xna.Framework.Color.B, Microsoft.Xna.Framework.Color.G, Microsoft.Xna.Framework.Color.R, Microsoft.Xna.Framework.Color.Transparent, and Terraria.Dust.type.