[longomatch] Fix Color conversion
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Fix Color conversion
- Date: Thu, 22 Dec 2011 21:36:37 +0000 (UTC)
commit e83d55d28054109c2e058f01deb7033111912511
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Thu Dec 22 22:36:04 2011 +0100
Fix Color conversion
LongoMatch.GUI/Gui/Helpers.cs | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Helpers.cs b/LongoMatch.GUI/Gui/Helpers.cs
index 2cd68f6..9483ce9 100644
--- a/LongoMatch.GUI/Gui/Helpers.cs
+++ b/LongoMatch.GUI/Gui/Helpers.cs
@@ -21,6 +21,8 @@ using Gtk;
using Gdk;
using Mono.Unix;
+using LongoMatch.Common;
+
namespace LongoMatch.Gui
{
public class Helpers
@@ -81,11 +83,14 @@ namespace LongoMatch.Gui
}
public static Color ToGdkColor(System.Drawing.Color color) {
- return new Color((byte)color.R, (byte)color.G, (byte)color.B);
+ return new Color(color.R, color.G, color.B);
}
public static System.Drawing.Color ToDrawingColor(Color color) {
- return System.Drawing.Color.FromArgb((int)color.Red, (int)color.Green, (int)color.Blue);
+ return System.Drawing.Color.FromArgb(
+ ColorHelper.ShortToByte(color.Red),
+ ColorHelper.ShortToByte(color.Green),
+ ColorHelper.ShortToByte(color.Blue));
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]