private void ApplyStyleEffect(ExcelDrawingEffectStyle chartEffect, ExcelChartStyleEntry section, int indexForColor, int numberOfItems) { if (section.HasEffect) { chartEffect.SetFromXml(section.Effect.EffectElement); } else if (section.EffectReference.Index > 0) //From theme { var theme = GetTheme(); if (theme.FormatScheme.EffectStyle.Count > section.EffectReference.Index - 1) { var effect = theme.FormatScheme.EffectStyle[section.EffectReference.Index - 1]; chartEffect.SetFromXml(effect.Effect.EffectElement); } } TransformColorEffect(chartEffect, section.EffectReference.Color, indexForColor, numberOfItems); }
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); } }