diff options
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HslColor.cs')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HslColor.cs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HslColor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HslColor.cs index 9d5fcdf600..5ede74043c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HslColor.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/HslColor.cs @@ -188,6 +188,13 @@ namespace MonoDevelop.Components return rv << 16 | gv << 8 | bv; } + public (byte R, byte G, byte B, byte A) ToRgba () + { + double r, g, b; + ToRgb (out r, out g, out b); + return ((byte)(r * 255), (byte)(g * 255), (byte) (b * 255), (byte)(Alpha * 255)); + } + public static HslColor FromPixel (uint pixel) { var r = ((pixel >> 16) & 0xFF) / 255.0; |