Example #1
0
        public async Task TestTweenSaturation()
        {
            var resolver = ObjectTests.GetResolver();

            resolver.Build();
            AGSSprite sprite = new AGSSprite(resolver, null);

            sprite.Tint = Color.FromHsla(100, 1f, 0.5f, 100);             //Lightness must be different than 1 for saturation to change

            await sprite.TweenSaturation(0f, 1f, Ease.QuadIn).Task;

            Assert.IsTrue(Math.Abs(sprite.Tint.GetSaturation()) < 0.0001f);

            await sprite.TweenSaturation(1f, 1f).Task;

            Assert.IsTrue(Math.Abs(1f - sprite.Tint.GetSaturation()) < 0.0001f);
        }