Create a quick and dirty style system.
This commit is contained in:
parent
c26dcfe3f3
commit
ecd31a5cde
@ -156,6 +156,11 @@ namespace Quik
|
||||
/// </summary>
|
||||
public QuikLine Line { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Stroke style of the line.
|
||||
/// </summary>
|
||||
public QuikStrokeStyle Style { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Create a draw line command.
|
||||
/// </summary>
|
||||
@ -179,6 +184,11 @@ namespace Quik
|
||||
/// </summary>
|
||||
public QuikLine[] Lines { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Stroke style of the lines.
|
||||
/// </summary>
|
||||
public QuikStrokeStyle Style { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Create a draw lines command.
|
||||
/// </summary>
|
||||
@ -202,6 +212,11 @@ namespace Quik
|
||||
/// </summary>
|
||||
public QuikBezier[] Segments;
|
||||
|
||||
/// <summary>
|
||||
/// Stroke style of the curve.
|
||||
/// </summary>
|
||||
public QuikStrokeStyle Style { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Create a draw Bezier curve command.
|
||||
/// </summary>
|
||||
@ -225,6 +240,21 @@ namespace Quik
|
||||
/// </summary>
|
||||
public QuikRectangle Rectangle { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Stroke style of the border.
|
||||
/// </summary>
|
||||
public QuikStrokeStyle StrokeStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fill style of the contents.
|
||||
/// </summary>
|
||||
public QuikFillStyle FillStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Radius for round corners.
|
||||
/// </summary>
|
||||
public float CornerRadius { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Create a draw rectangle command.
|
||||
/// </summary>
|
||||
@ -248,6 +278,21 @@ namespace Quik
|
||||
/// </summary>
|
||||
public QuikRectangle[] Rectangles { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Stroke style of the border.
|
||||
/// </summary>
|
||||
public QuikStrokeStyle StrokeStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fill style of the contents.
|
||||
/// </summary>
|
||||
public QuikFillStyle FillStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Radius for round corners.
|
||||
/// </summary>
|
||||
public float CornerRadius { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Create a draw rectangles commands.
|
||||
/// </summary>
|
||||
@ -271,6 +316,16 @@ namespace Quik
|
||||
/// </summary>
|
||||
public QuikEllipse Ellipse { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Stroke style of the border.
|
||||
/// </summary>
|
||||
public QuikStrokeStyle StrokeStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fill style of the contents.
|
||||
/// </summary>
|
||||
public QuikFillStyle FillStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Create a draw ellipse command.
|
||||
/// </summary>
|
||||
@ -294,6 +349,16 @@ namespace Quik
|
||||
/// </summary>
|
||||
public QuikEllipse[] Ellipses { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Stroke style of the border.
|
||||
/// </summary>
|
||||
public QuikStrokeStyle StrokeStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fill style of the contents.
|
||||
/// </summary>
|
||||
public QuikFillStyle FillStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Create a draw ellipses command.
|
||||
/// </summary>
|
||||
@ -317,6 +382,16 @@ namespace Quik
|
||||
/// </summary>
|
||||
public QuikTriangle Triangle { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Stroke style of the border.
|
||||
/// </summary>
|
||||
public QuikStrokeStyle StrokeStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fill style of the contents.
|
||||
/// </summary>
|
||||
public QuikFillStyle FillStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Create a draw triangle command.
|
||||
/// </summary>
|
||||
@ -340,6 +415,16 @@ namespace Quik
|
||||
/// </summary>
|
||||
public QuikTriangle[] Triangles { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Stroke style of the border.
|
||||
/// </summary>
|
||||
public QuikStrokeStyle StrokeStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fill style of the contents.
|
||||
/// </summary>
|
||||
public QuikFillStyle FillStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Create a draw triangles command.
|
||||
/// </summary>
|
||||
@ -364,6 +449,16 @@ namespace Quik
|
||||
/// </summary>
|
||||
public QuikVec2[] Polygon { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Stroke style of the border.
|
||||
/// </summary>
|
||||
public QuikStrokeStyle StrokeStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fill style of the contents.
|
||||
/// </summary>
|
||||
public QuikFillStyle FillStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Create a draw polygon command.
|
||||
/// </summary>
|
||||
|
70
Quik/QuikStyle.cs
Normal file
70
Quik/QuikStyle.cs
Normal file
@ -0,0 +1,70 @@
|
||||
namespace Quik
|
||||
{
|
||||
/// <summary>
|
||||
/// A line stipple pattern.
|
||||
/// </summary>
|
||||
public struct QuikStipplePattern
|
||||
{
|
||||
/// <summary>
|
||||
/// The stipple pitch value.
|
||||
/// </summary>
|
||||
public float Pitch;
|
||||
|
||||
/// <summary>
|
||||
/// The stipple duty cycle.
|
||||
/// </summary>
|
||||
public float DutyCycle;
|
||||
|
||||
public QuikStipplePattern(float pitch, float dutyCycle)
|
||||
{
|
||||
Pitch = pitch;
|
||||
DutyCycle = dutyCycle;
|
||||
}
|
||||
|
||||
public static QuikStipplePattern None => new QuikStipplePattern(0.0f, 1.0f);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stroke style for lines and borders.
|
||||
/// </summary>
|
||||
public class QuikStrokeStyle
|
||||
{
|
||||
/// <summary>
|
||||
/// Stroke color.
|
||||
/// </summary>
|
||||
public QuikColor Color { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Stroke width.
|
||||
/// </summary>
|
||||
public float Width { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Stroke stipple pattern.
|
||||
/// </summary>
|
||||
public QuikStipplePattern StipplePattern { get; set; }
|
||||
|
||||
public QuikStrokeStyle()
|
||||
{
|
||||
}
|
||||
|
||||
public QuikStrokeStyle(QuikColor color, float width, QuikStipplePattern pattern)
|
||||
{
|
||||
Color = color;
|
||||
Width = width;
|
||||
StipplePattern = pattern;
|
||||
}
|
||||
|
||||
public QuikStrokeStyle(QuikColor color, float width) : this(color, width, QuikStipplePattern.None)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fill style for rectangles and the like.
|
||||
/// </summary>
|
||||
public class QuikFillStyle
|
||||
{
|
||||
public QuikColor Color { get; set; }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user