using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Media;
namespace WpfApplication1
{
public class ColormapBrush
{
private double opacity = 1;
private Point startPoint = new Point(0, 0);
private Point endPoint = new Point(1, 0);
private LinearGradientBrush brush = new LinearGradientBrush();
public double Opacity
{
get { return opacity; }
set { opacity = value; }
}
public Point StartPoint
{
get { return startPoint; }
set { startPoint = value; }
}
public Point EndPoint
{
get { return endPoint; }
set { endPoint = value; }
}
public LinearGradientBrush Spring()
{
brush.GradientStops.Add(new GradientStop(Color.FromRgb(255, 0, 255), 0));
brush.GradientStops.Add(new GradientStop(Color.FromRgb(255, 255, 0), 1));
brush.StartPoint = StartPoint;
brush.EndPoint = EndPoint;
brush.Opacity = opacity;
return brush;
}
}
}