public static DuckGame.Color ColorSmooth(DuckGame.Color current, DuckGame.Color to, float amount) { Vec4 vector4_1 = current.ToVector4(); Vec4 vector4_2 = to.ToVector4(); Vec4 vec4 = vector4_1 + (vector4_2 - vector4_1) * amount; return(new DuckGame.Color(vec4.x, vec4.y, vec4.z, vec4.w)); }
public static DuckGame.Color Color(DuckGame.Color current, DuckGame.Color to, float amount) { Vec4 vector4_1 = current.ToVector4(); Vec4 vector4_2 = to.ToVector4(); Vec4 vec4_1 = vector4_2 - vector4_1; if ((double)vec4_1.Length() < 9.99999974737875E-05) { return(current); } vec4_1.Normalize(); Vec4 vec4_2 = vector4_1 + vec4_1 * amount; if ((double)vector4_2.x > (double)vector4_1.x && (double)vec4_2.x > (double)vector4_2.x) { vec4_2.x = vector4_2.x; } if ((double)vector4_2.x < (double)vector4_1.x && (double)vec4_2.x < (double)vector4_2.x) { vec4_2.x = vector4_2.x; } if ((double)vector4_2.y > (double)vector4_1.y && (double)vec4_2.y > (double)vector4_2.y) { vec4_2.y = vector4_2.y; } if ((double)vector4_2.y < (double)vector4_1.y && (double)vec4_2.y < (double)vector4_2.y) { vec4_2.y = vector4_2.y; } if ((double)vector4_2.z > (double)vector4_1.z && (double)vec4_2.z > (double)vector4_2.z) { vec4_2.z = vector4_2.z; } if ((double)vector4_2.z < (double)vector4_1.z && (double)vec4_2.z < (double)vector4_2.z) { vec4_2.z = vector4_2.z; } if ((double)vector4_2.w > (double)vector4_1.w && (double)vec4_2.w > (double)vector4_2.w) { vec4_2.w = vector4_2.w; } if ((double)vector4_2.w < (double)vector4_1.w && (double)vec4_2.w < (double)vector4_2.w) { vec4_2.w = vector4_2.w; } return(new DuckGame.Color(vec4_2.x, vec4_2.y, vec4_2.z, vec4_2.w)); }