Пример #1
0
        private void ApplyNewTransform(IEnumerable <IColorTransformItem> transforms, bool isSourceStyleTemplate = false)
        {
            foreach (var t in transforms)
            {
                switch (t.Type)
                {
                case eColorTransformType.Alpha:
                    Transforms.AddAlpha(t.Value);
                    break;

                case eColorTransformType.AlphaMod:
                    Transforms.AddAlphaModulation(t.Value);
                    break;

                case eColorTransformType.AlphaOff:
                    Transforms.AddAlphaOffset(t.Value);
                    break;

                case eColorTransformType.Blue:
                    Transforms.AddBlue(t.Value);
                    break;

                case eColorTransformType.BlueMod:
                    Transforms.AddBlueModulation(t.Value);
                    break;

                case eColorTransformType.BlueOff:
                    Transforms.AddBlueOffset(t.Value);
                    break;

                case eColorTransformType.Comp:
                    Transforms.AddComplement();
                    break;

                case eColorTransformType.Gamma:
                    Transforms.AddGamma();
                    break;

                case eColorTransformType.Gray:
                    Transforms.AddGray();
                    break;

                case eColorTransformType.Green:
                    Transforms.AddGreen(t.Value);
                    break;

                case eColorTransformType.GreenMod:
                    Transforms.AddGreenModulation(t.Value);
                    break;

                case eColorTransformType.GreenOff:
                    Transforms.AddGreenOffset(t.Value);
                    break;

                case eColorTransformType.Hue:
                    Transforms.AddHue(t.Value);
                    break;

                case eColorTransformType.HueMod:
                    Transforms.AddHueModulation(t.Value);
                    break;

                case eColorTransformType.HueOff:
                    Transforms.AddHueOffset(t.Value);
                    break;

                case eColorTransformType.Inv:
                    Transforms.AddInverse();
                    break;

                case eColorTransformType.InvGamma:
                    Transforms.AddGamma();
                    break;

                case eColorTransformType.Lum:
                    Transforms.AddLuminance(t.Value);
                    break;

                case eColorTransformType.LumMod:
                    Transforms.AddLuminanceModulation(t.Value);
                    break;

                case eColorTransformType.LumOff:
                    Transforms.AddLuminanceOffset(t.Value);
                    break;

                case eColorTransformType.Red:
                    Transforms.AddRed(t.Value);
                    break;

                case eColorTransformType.RedMod:
                    Transforms.AddRedModulation(t.Value);
                    break;

                case eColorTransformType.RedOff:
                    Transforms.AddRedOffset(t.Value);
                    break;

                case eColorTransformType.Sat:
                    Transforms.AddSaturation(t.Value);
                    break;

                case eColorTransformType.SatMod:
                    Transforms.AddSaturationModulation(t.Value);
                    break;

                case eColorTransformType.SatOff:
                    Transforms.AddSaturationOffset(t.Value);
                    break;

                case eColorTransformType.Shade:
                    Transforms.AddShade(t.Value);
                    break;

                case eColorTransformType.Tint:
                    Transforms.AddTint(t.Value);
                    break;
                }
                if (isSourceStyleTemplate && Transforms.Count > 0)
                {
                    ((ISource)Transforms.Last())._fromStyleTemplate = true;
                }
            }
        }
Пример #2
0
        private void ApplyNewTransform(IEnumerable <IColorTransformItem> transforms)
        {
            foreach (var t in transforms)
            {
                switch (t.Type)
                {
                case eColorTransformType.Alpha:
                    Transforms.AddAlpha(t.Value);
                    break;

                case eColorTransformType.AlphaMod:
                    Transforms.AddAlphaModulation(t.Value);
                    break;

                case eColorTransformType.AlphaOff:
                    Transforms.AddAlphaOffset(t.Value);
                    break;

                case eColorTransformType.Blue:
                    Transforms.AddBlue(t.Value);
                    break;

                case eColorTransformType.BlueMod:
                    Transforms.AddBlueModulation(t.Value);
                    break;

                case eColorTransformType.BlueOff:
                    Transforms.AddBlueOffset(t.Value);
                    break;

                case eColorTransformType.Comp:
                    Transforms.AddComplement();
                    break;

                case eColorTransformType.Gamma:
                    Transforms.AddGamma();
                    break;

                case eColorTransformType.Gray:
                    Transforms.AddGray();
                    break;

                case eColorTransformType.Green:
                    Transforms.AddGreen(t.Value);
                    break;

                case eColorTransformType.GreenMod:
                    Transforms.AddGreenModulation(t.Value);
                    break;

                case eColorTransformType.GreenOff:
                    Transforms.AddGreenOffset(t.Value);
                    break;

                case eColorTransformType.Hue:
                    Transforms.AddHue(t.Value);
                    break;

                case eColorTransformType.HueMod:
                    Transforms.AddHueModulation(t.Value);
                    break;

                case eColorTransformType.HueOff:
                    Transforms.AddHueOffset(t.Value);
                    break;

                case eColorTransformType.Inv:
                    Transforms.AddInverse();
                    break;

                case eColorTransformType.InvGamma:
                    Transforms.AddGamma();
                    break;

                case eColorTransformType.Lum:
                    Transforms.AddLuminance(t.Value);
                    break;

                case eColorTransformType.LumMod:
                    Transforms.AddLuminanceModulation(t.Value);
                    break;

                case eColorTransformType.LumOff:
                    Transforms.AddLuminanceOffset(t.Value);
                    break;

                case eColorTransformType.Red:
                    Transforms.AddRed(t.Value);
                    break;

                case eColorTransformType.RedMod:
                    Transforms.AddRedModulation(t.Value);
                    break;

                case eColorTransformType.RedOff:
                    Transforms.AddRedOffset(t.Value);
                    break;

                case eColorTransformType.Sat:
                    Transforms.AddSaturation(t.Value);
                    break;

                case eColorTransformType.SatMod:
                    Transforms.AddSaturationModulation(t.Value);
                    break;

                case eColorTransformType.SatOff:
                    Transforms.AddSaturationOffset(t.Value);
                    break;

                case eColorTransformType.Shade:
                    Transforms.AddShade(t.Value);
                    break;

                case eColorTransformType.Tint:
                    Transforms.AddTint(t.Value);
                    break;
                }
            }
        }