public static SsColorRef[] CreateArray(int num) { var a = new SsColorRef[num]; for (int i = 0; i < a.Length; ++i) a[i] = new SsColorRef(); return a; }
public SsColorRef(SsColorRef r) { R = r.R; G = r.G; B = r.B; A = r.A; }
public SsColorRef(SsColorRef r) { R = r.R; G = r.G; B = r.B; A = r.A; }
public SsColorRef[] Colors; // [0]:left top(or whole color) [1]:right top [2]:left bottom [3]:right bottom public SsColorBlendKeyValue(int colorsNum) { Target = SsColorBlendTarget.None; Operation = SsColorBlendOperation.Mix; if (colorsNum > 0) { Colors = SsColorRef.CreateArray(colorsNum); } }
static public SsColorRef[] CreateArray(int num) { var a = new SsColorRef[num]; for (int i = 0; i < a.Length; ++i) { a[i] = new SsColorRef(); } return(a); }
_GetColorRef( SsColorRef o, XmlNode n, string path) { if (path != null) { n = _SelectSingleNode(n, path); } o.R = _ToByte(_GetNodeValue(n, "./cur:Red")); o.G = _ToByte(_GetNodeValue(n, "./cur:Green")); o.B = _ToByte(_GetNodeValue(n, "./cur:Blue")); o.A = _ToByte(_GetNodeValue(n, "./cur:Alpha")); }
GetBlendedColor(SsColorRef src, SsColorBlendOperation op) { Color c = (Color)src; if (op == SsColorBlendOperation.Mul) { // to decrease vertex color's effect, must come near color value to 1 #if false // lerp with C# c.r = SsInterpolation.Linear(1f - c.a, c.r, 1f); c.g = SsInterpolation.Linear(1f - c.a, c.g, 1f); c.b = SsInterpolation.Linear(1f - c.a, c.b, 1f); // shader: combine texture * primary, texture #else // lerp with shader // shader is like this: // combine primary lerp (primary) constant=(1,1,1,1), texture // combine previous * texture, texture #endif } return(c); }
public SsInterpolatable GetInterpolated(SsCurveParams curve, float time, SsInterpolatable start, SsInterpolatable end, int startTime, int endTime) { var v = new SsColorRef(); return v.Interpolate(curve, time, start, end, startTime, endTime); }
_GetColorRef(SsColorRef o, XmlNode n) { _GetColorRef(o, n, null); }
public SsInterpolatable GetInterpolated(SsCurveParams curve, float time, SsInterpolatable start, SsInterpolatable end, int startTime, int endTime) { var v = new SsColorRef(); return(v.Interpolate(curve, time, start, end, startTime, endTime)); }