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

◆ GetColor()

Color Terraria.NPC.GetColor ( Color newColor)
inline

Definition at line 90365 of file NPC.cs.

90366 {
90368 {
90370 }
90371 int num = color.R - (255 - newColor.R);
90372 int num2 = color.G - (255 - newColor.G);
90373 int num3 = color.B - (255 - newColor.B);
90374 int num4 = color.A - (255 - newColor.A);
90375 if (num < 0)
90376 {
90377 num = 0;
90378 }
90379 if (num > 255)
90380 {
90381 num = 255;
90382 }
90383 if (num2 < 0)
90384 {
90385 num2 = 0;
90386 }
90387 if (num2 > 255)
90388 {
90389 num2 = 255;
90390 }
90391 if (num3 < 0)
90392 {
90393 num3 = 0;
90394 }
90395 if (num3 > 255)
90396 {
90397 num3 = 255;
90398 }
90399 if (num4 < 0)
90400 {
90401 num4 = 0;
90402 }
90403 if (num4 > 255)
90404 {
90405 num4 = 255;
90406 }
90408 {
90409 num = (byte)((float)num * (1f - shimmerTransparency));
90410 num2 = (byte)((float)num2 * (1f - shimmerTransparency));
90411 num3 = (byte)((float)num3 * (1f - shimmerTransparency));
90412 num4 = (byte)((float)num4 * (1f - shimmerTransparency));
90413 }
90414 return new Color(num, num2, num3, num4);
90415 }
bool CanApplyHunterPotionEffects()
Definition NPC.cs:87774
Color GetBestiaryEntryColor()
Definition NPC.cs:90098
float shimmerTransparency
Definition NPC.cs:207
bool IsABestiaryIconDummy
Definition NPC.cs:33

References Microsoft.Xna.Framework.Graphics.Color.