894c3e6eba
git-svn-id: https://triangle.svn.codeplex.com/svn@69965 0e2699bc-83d4-4a8f-98e7-55e24ab8c7a5
35 lines
977 B
C#
35 lines
977 B
C#
// -----------------------------------------------------------------------
|
|
// <copyright file="ExtensionMethods.cs" company="">
|
|
// TODO: Update copyright text.
|
|
// </copyright>
|
|
// -----------------------------------------------------------------------
|
|
|
|
namespace MeshRenderer.Core
|
|
{
|
|
using System;
|
|
using System.Drawing;
|
|
|
|
/// <summary>
|
|
/// Extension methods.
|
|
/// </summary>
|
|
public static class ExtensionMethods
|
|
{
|
|
#region Color extention methods
|
|
|
|
/// <summary>
|
|
/// Converts a Color to a float array containing normalized R, G ,B, A values.
|
|
/// </summary>
|
|
public static float[] ToFloatArray4(this Color color)
|
|
{
|
|
return new float[] {
|
|
((float)color.R) / 255.0f,
|
|
((float)color.G) / 255.0f,
|
|
((float)color.B) / 255.0f,
|
|
((float)color.A) / 255.0f
|
|
};
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|