[cogl/wip/cogl-sharp: 14/42] cogl-sharp: Gives 2 constuctors to Color
- From: Damien Lespiau <dlespiau src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/wip/cogl-sharp: 14/42] cogl-sharp: Gives 2 constuctors to Color
- Date: Mon, 22 Oct 2012 11:10:47 +0000 (UTC)
commit f863e30205366adc220653c4930f712d7787a19c
Author: Damien Lespiau <damien lespiau intel com>
Date: Sat Sep 29 20:58:32 2012 +0100
cogl-sharp: Gives 2 constuctors to Color
CoglColor can be initialized with floats or bytes, let's expose the same
convience here.
cogl-sharp/Color.cs | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/cogl-sharp/Color.cs b/cogl-sharp/Color.cs
index e01edaf..3b98517 100644
--- a/cogl-sharp/Color.cs
+++ b/cogl-sharp/Color.cs
@@ -36,6 +36,22 @@ namespace Cogl
public float blue;
public float alpha;
+ public Color(float r, float g, float b, float a)
+ {
+ red = r;
+ green = g;
+ blue = b;
+ alpha = a;
+ }
+
+ public Color(byte r, byte g, byte b, byte a)
+ {
+ red = r / 255.0f;
+ green = g / 255.0f;
+ blue = b / 255.0f;
+ alpha = a / 255.0f;
+ }
+
[DllImport("cogl2.dll")]
private static extern void cogl_color_premultiply(ref Color color);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]