Pastel library Xamarin-iOS version
Pastel is swift library for gradient animation effects, we've inspired from this project. Xamarin-iOS didn't had anything like gradient animation library, so we rewrited C# version of it for Xamarin.
Installing / Getting started
You can install library from the NuGet Packages. https://www.nuget.org/packages/MPDC.Xamarin.iOS.Pastel
From the console you can
PM> Install-Package MPDC.Xamarin.iOS.Pastel
Developing
This project is in very begining stage, so if you have some improvements or bug fixes, feel free to send PR
Example
public override void ViewDidLoad()
{
base.ViewDidLoad();
// Initializing pastelView object
var pastelView = new MPDCPastelXamarinIOS.PastelView(View.Bounds);
pastelView.AnimationDuration = 2.0;
// init start point and end point
pastelView.StartPoint = PastelPoint.BottomLeft.Point();
pastelView.EndPoint = PastelPoint.TopRight.Point();
// seting colors
pastelView.SetColors(PastelGradient.WinterNeva.Colors());
// pastelView.AddColor(SecondGradientColor);
pastelView.StartAnimation();
View.InsertSubview(pastelView,0);
}
}
You need to include MPDCPastelXamarinIOS.Extensions namespace to use Colors and Point extension methods.
In PastelGradient enum, we have some custom gradient colors
- Warflame
- NightFade
- SpringWarmth
- JuicyPeach
- YoungPassion
- LadyLips
- SunnyMorning
- RainyAshville
- FrozenDreams
- WinterNeva
You can use this custom colors, or feel free to add some more gradient colors.
In SetColors method you can implement and add your own colors array.
For startpoint and endpoint you have 8 point choice.
- Left
- Top
- Right
- Bottom
- TopLeft
- TopRight
- BottomLeft
- BottomRight
Contributing
"If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome."
Credits
This software uses some code examples from open source Swift Pastel project.
Authors
Licensing
"The code in this project is licensed under MIT license."