76 lines
2.3 KiB
C#
76 lines
2.3 KiB
C#
using System;
|
|
using UnityEngine.Scripting;
|
|
|
|
namespace UnityEngine
|
|
{
|
|
// Token: 0x020003D6 RID: 982
|
|
[UsedByNativeCode]
|
|
[IL2CPPStructAlignment(Align = 4)]
|
|
public struct Color32
|
|
{
|
|
// Token: 0x060037FF RID: 14335 RVA: 0x0005FE70 File Offset: 0x0005E070
|
|
public Color32(byte r, byte g, byte b, byte a)
|
|
{
|
|
this.r = r;
|
|
this.g = g;
|
|
this.b = b;
|
|
this.a = a;
|
|
}
|
|
|
|
// Token: 0x06003800 RID: 14336 RVA: 0x0005FE90 File Offset: 0x0005E090
|
|
public static implicit operator Color32(Color c)
|
|
{
|
|
return new Color32((byte)(Mathf.Clamp01(c.r) * 255f), (byte)(Mathf.Clamp01(c.g) * 255f), (byte)(Mathf.Clamp01(c.b) * 255f), (byte)(Mathf.Clamp01(c.a) * 255f));
|
|
}
|
|
|
|
// Token: 0x06003801 RID: 14337 RVA: 0x0005FEF8 File Offset: 0x0005E0F8
|
|
public static implicit operator Color(Color32 c)
|
|
{
|
|
return new Color((float)c.r / 255f, (float)c.g / 255f, (float)c.b / 255f, (float)c.a / 255f);
|
|
}
|
|
|
|
// Token: 0x06003802 RID: 14338 RVA: 0x0005FF4C File Offset: 0x0005E14C
|
|
public static Color32 Lerp(Color32 a, Color32 b, float t)
|
|
{
|
|
t = Mathf.Clamp01(t);
|
|
return new Color32((byte)((float)a.r + (float)(b.r - a.r) * t), (byte)((float)a.g + (float)(b.g - a.g) * t), (byte)((float)a.b + (float)(b.b - a.b) * t), (byte)((float)a.a + (float)(b.a - a.a) * t));
|
|
}
|
|
|
|
// Token: 0x06003803 RID: 14339 RVA: 0x0005FFE0 File Offset: 0x0005E1E0
|
|
public static Color32 LerpUnclamped(Color32 a, Color32 b, float t)
|
|
{
|
|
return new Color32((byte)((float)a.r + (float)(b.r - a.r) * t), (byte)((float)a.g + (float)(b.g - a.g) * t), (byte)((float)a.b + (float)(b.b - a.b) * t), (byte)((float)a.a + (float)(b.a - a.a) * t));
|
|
}
|
|
|
|
// Token: 0x06003804 RID: 14340 RVA: 0x0006006C File Offset: 0x0005E26C
|
|
public override string ToString()
|
|
{
|
|
return UnityString.Format("RGBA({0}, {1}, {2}, {3})", new object[] { this.r, this.g, this.b, this.a });
|
|
}
|
|
|
|
// Token: 0x06003805 RID: 14341 RVA: 0x000600CC File Offset: 0x0005E2CC
|
|
public string ToString(string format)
|
|
{
|
|
return UnityString.Format("RGBA({0}, {1}, {2}, {3})", new object[]
|
|
{
|
|
this.r.ToString(format),
|
|
this.g.ToString(format),
|
|
this.b.ToString(format),
|
|
this.a.ToString(format)
|
|
});
|
|
}
|
|
|
|
// Token: 0x04000D2E RID: 3374
|
|
public byte r;
|
|
|
|
// Token: 0x04000D2F RID: 3375
|
|
public byte g;
|
|
|
|
// Token: 0x04000D30 RID: 3376
|
|
public byte b;
|
|
|
|
// Token: 0x04000D31 RID: 3377
|
|
public byte a;
|
|
}
|
|
}
|