private void TransformColor(ExcelDrawingColorManager color, ExcelChartStyleColorManager templateColor, int colorIndex, int numberOfItems) { if (templateColor != null && templateColor.ColorType == eDrawingColorType.ChartStyleColor && color.ColorType == eDrawingColorType.Scheme && color.SchemeColor.Color == eSchemeColor.Style) { ColorsManager.Transform(color, templateColor.StyleColor.Index ?? colorIndex, numberOfItems); } else if (color.ColorType == eDrawingColorType.Scheme && color.SchemeColor.Color == eSchemeColor.Style) { ColorsManager.Transform(color, colorIndex, numberOfItems); } }
private void TransformColorThreeD(ExcelDrawing3D threeD, ExcelChartStyleColorManager color, int colorIndex, int numberOfItems) { if (threeD.ExtrusionColor.ColorType == eDrawingColorType.Scheme && threeD.ExtrusionColor.SchemeColor.Color == eSchemeColor.Style) { TransformColor(threeD.ExtrusionColor, color, colorIndex, numberOfItems); } if (threeD.ContourColor.ColorType == eDrawingColorType.Scheme && threeD.ContourColor.SchemeColor.Color == eSchemeColor.Style) { TransformColor(threeD.ContourColor, color, colorIndex, numberOfItems); } }
private void TransformColorFillBasic(ExcelDrawingFillBasic fill, ExcelChartStyleColorManager color, int colorIndex, int numberOfItems) { switch (fill.Style) { case eFillStyle.SolidFill: TransformColor(fill.SolidFill.Color, color, colorIndex, numberOfItems); break; case eFillStyle.GradientFill: foreach (var grad in fill.GradientFill.Colors) { TransformColor(grad.Color, color, colorIndex, numberOfItems); } break; } }
private void TransformColorFill(ExcelDrawingFill fill, ExcelChartStyleColorManager color, int colorIndex, int numberOfItems) { switch (fill.Style) { case eFillStyle.PatternFill: TransformColor(fill.PatternFill.BackgroundColor, color, colorIndex, numberOfItems); TransformColor(fill.PatternFill.ForegroundColor, color, colorIndex, numberOfItems); break; case eFillStyle.BlipFill: if (fill.BlipFill.Effects.Duotone != null) { TransformColor(fill.BlipFill.Effects.Duotone.Color1, color, colorIndex, numberOfItems); TransformColor(fill.BlipFill.Effects.Duotone.Color2, color, colorIndex, numberOfItems); } break; default: TransformColorFillBasic(fill, color, colorIndex, numberOfItems); break; } }
private void TransformColorEffect(ExcelDrawingEffectStyle effect, ExcelChartStyleColorManager color, int colorIndex, int numberOfItems) { if (effect.HasInnerShadow && effect.InnerShadow.Color.ColorType == eDrawingColorType.Scheme && effect.InnerShadow.Color.SchemeColor.Color == eSchemeColor.Style) { TransformColor(effect.InnerShadow.Color, color, colorIndex, numberOfItems); } if (effect.HasOuterShadow && effect.OuterShadow.Color.ColorType == eDrawingColorType.Scheme && effect.OuterShadow.Color.SchemeColor.Color == eSchemeColor.Style) { TransformColor(effect.OuterShadow.Color, color, colorIndex, numberOfItems); } if (effect.HasPresetShadow && effect.PresetShadow.Color.ColorType == eDrawingColorType.Scheme && effect.PresetShadow.Color.SchemeColor.Color == eSchemeColor.Style) { TransformColor(effect.PresetShadow.Color, color, colorIndex, numberOfItems); } if (effect.HasGlow && effect.Glow.Color.ColorType == eDrawingColorType.Scheme && effect.Glow.Color.SchemeColor.Color == eSchemeColor.Style) { TransformColor(effect.Glow.Color, color, colorIndex, numberOfItems); } if (effect.HasFillOverlay) { TransformColorFill(effect.FillOverlay.Fill, color, colorIndex, numberOfItems); } }
private void TransformColorBorder(ExcelDrawingBorder border, ExcelChartStyleColorManager color, int colorIndex, int numberOfItems) { TransformColorFillBasic(border.Fill, color, colorIndex, numberOfItems); }