Exemplo n.º 1
0
        public void TestGeneratedGradient(SKCanvas canvas)
        {
            // Create new Orange
            var Orange = new KimonoColor(255, 128, 0, 255);

            // Create new Purple
            var Purple = new KimonoColor(128, 0, 255, 255);

            // The Gradient's Color List
            SKColor[] GradientColors = { new SKColor(255, 255, 255, 255), Orange.Color, Purple.Color, new SKColor(0, 0, 0, 255) };

            // The Gradient's Weight List
            float[] GradientWeights = { 0f, 0.3047369f, 0.7118111f, 0.9662447f };

            // Create new Gradient
            var Gradient = new KimonoGradient(KimonoGradientType.LinearGradient, new KimonoHandle(0, 0), new KimonoHandle(168, 168), 88f, SKShaderTileMode.Clamp, GradientColors, GradientWeights);
            // Mix paint
            var paint = new SKPaint()
            {
                Shader = Gradient.Shader
            };

            // Draw rect
            var rect = new SKRect(0, 0, 640, 480);

            canvas.DrawRect(rect, paint);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Raises the make duplicate event.
 /// </summary>
 /// <param name="color">Color.</param>
 internal void RaiseMakeDuplicate(KimonoColor color)
 {
     // Inform caller of event
     if (MakeDuplicate != null)
     {
         MakeDuplicate(color);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Raises the color of the remove event.
 /// </summary>
 /// <param name="color">Color.</param>
 internal void RaiseRemoveColor(KimonoColor color)
 {
     // Inform caller of event
     if (RemoveColor != null)
     {
         RemoveColor(color);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Raises the color modified event.
 /// </summary>
 /// <param name="color">Color.</param>
 internal void RaiseColorModified(KimonoColor color)
 {
     // Inform caller of event
     if (ColorModified != null)
     {
         ColorModified(color);
     }
 }