forked from izrik/FbxSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFbxColor.cs
57 lines (51 loc) · 1.35 KB
/
FbxColor.cs
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System;
namespace FbxSharp
{
public struct FbxColor
{
public FbxColor(FbxColor pValue)
{
Red = pValue.Red;
Green = pValue.Green;
Blue = pValue.Blue;
Alpha = pValue.Alpha;
}
public FbxColor(double pRed, double pGreen, double pBlue, double pAlpha=1.0)
{
Red = pRed;
Green = pGreen;
Blue = pBlue;
Alpha = pAlpha;
}
public FbxColor(FbxVector3 pRGB, double pAlpha=1.0)
{
Red = pRGB.X;
Green = pRGB.Y;
Blue = pRGB.Z;
Alpha = pAlpha;
}
public FbxColor(FbxVector4 pRGBA)
{
Red = pRGBA.X;
Green = pRGBA.Y;
Blue = pRGBA.Z;
Alpha = pRGBA.W;
}
public readonly double Red;
public readonly double Green;
public readonly double Blue;
public readonly double Alpha;
public override string ToString()
{
return string.Format("{{R:{0} G:{1} B:{2} A:{3}}}", Red, Green, Blue, Alpha);
}
public FbxVector4 ToVector4()
{
return new FbxVector4(Red, Green, Blue, Alpha);
}
public FbxVector3 ToVector3()
{
return new FbxVector3(Red, Green, Blue);
}
}
}