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

◆ GetColor()

Color Terraria.Item.GetColor ( Color newColor)
inline

Definition at line 47907 of file Item.cs.

47908 {
47909 int num = color.R - (255 - newColor.R);
47910 int num2 = color.G - (255 - newColor.G);
47911 int num3 = color.B - (255 - newColor.B);
47912 int num4 = color.A - (255 - newColor.A);
47913 if (num < 0)
47914 {
47915 num = 0;
47916 }
47917 if (num > 255)
47918 {
47919 num = 255;
47920 }
47921 if (num2 < 0)
47922 {
47923 num2 = 0;
47924 }
47925 if (num2 > 255)
47926 {
47927 num2 = 255;
47928 }
47929 if (num3 < 0)
47930 {
47931 num3 = 0;
47932 }
47933 if (num3 > 255)
47934 {
47935 num3 = 255;
47936 }
47937 if (num4 < 0)
47938 {
47939 num4 = 0;
47940 }
47941 if (num4 > 255)
47942 {
47943 num4 = 255;
47944 }
47945 return new Color(num, num2, num3, num4);
47946 }

Referenced by Terraria.DataStructures.PlayerDrawLayers.DrawPlayer_27_HeldItem().