public override SolidColorBrush GetMaterial( Swatch materialSet) { var material1 = materialSet.GetMaterial(Luminosity1); var material2 = materialSet.GetMaterial(Luminosity2); var avgLumIndex = (Luminosity1.LuminosityIndex + Luminosity2.LuminosityIndex) / 2d; var finalLum = new Luminosity((int)avgLumIndex.Round(), Luminosity1.IsAccent); var interpolatedMaterial = material1.Brush.Color.Blend(material2.Brush.Color, Progression); var finalColor = interpolatedMaterial.WithOpacity(Opacity); var m1Identity = material1.Identity; //TODO should the finalLum's isAccent be m1Identity's or Luminosity1.Isaccent? was m1Identity. var finalIdentity = new MaterialIdentity( m1Identity.SwatchClassifier, finalLum, Opacity); var finalMaterial = new SolidColorBrush( finalColor) .SetIdentity( finalIdentity); return(finalMaterial); }
public override SolidColorBrush GetMaterial( Swatch swatch) { var material = swatch.GetMaterial(Luminosity); if (Opacity == 1d) { return(material); } return(material.WithOpacity(Opacity)); }