/// <summary> /// Merges background styles. /// </summary> public static IFill Merge(BackgroundStyle style1, BackgroundStyle style2, float weight, out ITransform blendTransform, out IMapper mapper) { if (style1 == null && style2 == null) { blendTransform = null; mapper = null; return(null); } if (style1 == null && style2 != null) { return(Merge(style2, style1, 1.0f - weight, out blendTransform, out mapper)); } if (style2 == null) { mapper = style1.Mapper; blendTransform = style1.MappingTransform; return(style1.Fill); } blendTransform = BlendTransform.BlendTransforms(style1.MappingTransform, style2.MappingTransform, weight); mapper = style2.Mapper; return(BlendedFill.BlendFills(style1.Fill, style2.Fill, weight)); }
public ISubStyle Clone() { BackgroundStyle style = new BackgroundStyle(); style.Parent = parent; style.fill = fill; return(style); }