26 lines
835 B
C#
26 lines
835 B
C#
using Terraria.ModLoader;
|
|
using Terraria;
|
|
using Microsoft.Xna.Framework;
|
|
using System;
|
|
|
|
namespace ForgottenWawiTech.Content.Rarities
|
|
{
|
|
public class FWTDeveloperItem : ModRarity
|
|
{
|
|
// Smoothly fades between Bright Magenta and Dark Red.
|
|
public override Color RarityColor
|
|
{
|
|
get
|
|
{
|
|
// Speed in cycles per second
|
|
const float cyclesPerSecond = 0.75f;
|
|
float theta = Main.GlobalTimeWrappedHourly * cyclesPerSecond * MathHelper.TwoPi;
|
|
float t = (float)((Math.Sin(theta) + 1f) * 0.5f); // 0..1
|
|
|
|
Color darkRed = new Color(139, 0, 0); // Dark Red
|
|
Color brightMagenta = Color.Magenta; // Bright Magenta
|
|
return Color.Lerp(darkRed, brightMagenta, t);
|
|
}
|
|
}
|
|
}
|
|
} |