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

◆ GetColor()

Color Terraria.Item.GetColor ( Color newColor)
inline

Definition at line 49459 of file Item.cs.

49460 {
49461 //IL_00bc: Unknown result type (might be due to invalid IL or missing references)
49462 int num = ((Color)(ref color)).R - (255 - ((Color)(ref newColor)).R);
49463 int num2 = ((Color)(ref color)).G - (255 - ((Color)(ref newColor)).G);
49464 int num3 = ((Color)(ref color)).B - (255 - ((Color)(ref newColor)).B);
49465 int num4 = ((Color)(ref color)).A - (255 - ((Color)(ref newColor)).A);
49466 if (num < 0)
49467 {
49468 num = 0;
49469 }
49470 if (num > 255)
49471 {
49472 num = 255;
49473 }
49474 if (num2 < 0)
49475 {
49476 num2 = 0;
49477 }
49478 if (num2 > 255)
49479 {
49480 num2 = 255;
49481 }
49482 if (num3 < 0)
49483 {
49484 num3 = 0;
49485 }
49486 if (num3 > 255)
49487 {
49488 num3 = 255;
49489 }
49490 if (num4 < 0)
49491 {
49492 num4 = 0;
49493 }
49494 if (num4 > 255)
49495 {
49496 num4 = 255;
49497 }
49498 return new Color(num, num2, num3, num4);
49499 }
Color color
Draws the item sprite with a colored tint. Gel and Sharkfin use this to spawn different colored items...
Definition Item.cs:506

References Terraria.Item.color.

Referenced by Terraria.UI.ItemSlot.DrawItemIcon(), Terraria.DataStructures.PlayerDrawLayers.DrawPlayer_27_HeldItem(), Terraria.ModLoader.Config.UI.ItemDefinitionOptionElement.DrawSelf(), and Terraria.GameContent.Drawing.TileDrawing.DrawSpecialTilesLegacy().

+ Here is the caller graph for this function: