/// <summary> /// Blends styles. /// </summary> public static Pen Merge(BorderStyle style1, BorderStyle style2, float weight, out ITransform transform, out IMapper mapper) { if (style1 == null && style2 == null) { transform = null; mapper = null; return(null); } if (style2 != null && style1 == null) { return(Merge(style2, style1, 1.0f - weight, out transform, out mapper)); } if (style2 == null) { transform = style1.MappingTransform; mapper = style1.Mapper; return(style1.Pen); } transform = BlendTransform.BlendTransforms(style1.MappingTransform, style2.MappingTransform, weight); mapper = style1.Mapper; return(Pen.BlendPens(style1.Pen, style2.Pen, weight)); }
/// <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)); }