aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/Colors.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-02-02 23:38:54 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-02-02 23:38:54 +0100
commit67bd044b6e5fe52b8b76cc5d7eb8fd0ce9dc3ee9 (patch)
treeb94ae5e6ef363eab5f0888b459789ecea9ac5d5d /src/Colors.cs
parent2b087282dd73152d21140ea7312a90e046c84f61 (diff)
Gradient, Bitmap and Svg Filling
Diffstat (limited to 'src/Colors.cs')
-rw-r--r--src/Colors.cs18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/Colors.cs b/src/Colors.cs
index c88e1729..ccc42493 100644
--- a/src/Colors.cs
+++ b/src/Colors.cs
@@ -10,7 +10,7 @@ using System.Diagnostics;
namespace Crow
{
- public struct Color : ICairoFill
+ public struct Color
{
#region CTOR
public Color(double _R, double _G, double _B, double _A)
@@ -63,7 +63,6 @@ namespace Crow
return cr;
}
}
-
return new Color(
double.Parse(c[0]),
double.Parse(c[1]),
@@ -92,6 +91,10 @@ namespace Crow
{
return new Cairo.Color(c.R, c.G, c.B, c.A);
}
+ public static implicit operator Fill(Color c){
+ return new SolidColor (c) as Fill;
+ }
+
public static bool operator ==(Color left, Color right)
{
@@ -147,16 +150,7 @@ namespace Crow
{
return new Color (this.R, this.G, this.B, _A);
}
-
- #region IFill implementation
-
- public void SetAsSource (Cairo.Context ctx)
- {
- ctx.SetSourceRGBA (R, G, B, A);
- }
-
- #endregion
-
+
#region Predefined colors
public static readonly Color Transparent = new Color(0, 0, 0, 0, "Transparent");
public static readonly Color Clear = new Color(-1, -1, -1, -1, "Clear");