Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
ColorExtensions.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using SiliconStudio.Core.Mathematics;
4 
5 namespace SiliconStudio.Presentation.Extensions
6 {
8  using SystemColors = System.Windows.Media.Colors;
9 
10  public static class ColorExtensions
11  {
12  public static SystemColor ToSystemColor(this ColorHSV color)
13  {
14  return ToSystemColor(color.ToColor());
15  }
16 
17  public static SystemColor ToSystemColor(this Color4 color)
18  {
19  var byteColor = new Color(color);
20  return SystemColor.FromArgb(byteColor.A, byteColor.R, byteColor.G, byteColor.B);
21  }
22  }
23 }
System.Windows.Media.Colors SystemColors
static SystemColor ToSystemColor(this Color4 color)
System.Windows.Media.Color SystemColor
Represents a color in the form of rgba.
Definition: Color4.cs:42
SiliconStudio.Core.Mathematics.Color Color
Definition: ColorPicker.cs:14
static SystemColor ToSystemColor(this ColorHSV color)
Color4 ToColor()
Converts the color into a three component vector.
Definition: ColorHSV.cs:60
Represents a color in the form of Hue, Saturation, Value, Alpha.
Definition: ColorHSV.cs:15