-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNormalizedColor.cs
More file actions
28 lines (25 loc) · 863 Bytes
/
Copy pathNormalizedColor.cs
File metadata and controls
28 lines (25 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace UnityLoader
{
public class NormalizedColor
{
public float R { get; set; }
public float G { get; set; }
public float B { get; set; }
public float A { get; set; }
public NormalizedColor(float red, float green, float blue, float alpha = 255)
{
R = red; G = green; B = blue; A = alpha;
}
public Color ColorToUnity() { return new Color(RedToUnity(), GreenToUnity(), BlueToUnity(), AlphaToUnity()); }
public float RedToUnity() { return R / 255f; }
public float GreenToUnity() { return G / 255f; }
public float BlueToUnity() { return B / 255f; }
public float AlphaToUnity() { return A / 255f; }
}
}