/// <summary> /// Gets a color for given 0 to 1 ratio (i.e. position in range) /// </summary> /// <param name="ratio">The ratio - position in range from 0 to 1.</param> /// <returns></returns> public ColorHSVPoint GetHSVColor(Double ratio) { if (!IsReady) { Prepare(); } ColorHSVPoint output = BaseColor.Clone(); if (gradient.HasFlag(ColorGradientFunction.Hue)) { output.H = Convert.ToInt32(RangeH.GetValueForRangePosition(ratio)); } if (gradient.HasFlag(ColorGradientFunction.Value)) { output.V = Convert.ToSingle(RangeV.GetValueForRangePosition(ratio)); } if (gradient.HasFlag(ColorGradientFunction.Saturation)) { output.S = Convert.ToSingle(RangeS.GetValueForRangePosition(ratio)); // output.S + r.S; } if (gradient.HasFlag(ColorGradientFunction.Alpha)) { output.A = Convert.ToSingle(RangeA.GetValueForRangePosition(ratio)); } output.DeployValues(); return(output); }
/// <summary> /// Create clone of me. /// </summary> /// <returns></returns> public ThemeProfile Clone() { return(new ThemeProfile { Name = Name, GlobalFont = this.GlobalFont.Clone(), BaseColor = BaseColor.Clone(), GlobalKeyColor = GlobalKeyColor, TitleBarColor = TitleBarColor.Clone(), BackstageColor = BackstageColor.Clone(), AccountSelectionFlipColor = AccountSelectionFlipColor.Clone(), SearchFlipColor = SearchFlipColor.Clone(), UserFlipColor = UserFlipColor.Clone(), TabColor = this.TabColor.Clone(), TweetDefaultColor = this.TweetDefaultColor.Clone(), TweetMyselfColor = this.TweetMyselfColor.Clone(), TweetMentionColor = this.TweetMentionColor.Clone(), TweetRetweetColor = this.TweetRetweetColor.Clone(), TweetDirectMessageColor = this.TweetDirectMessageColor.Clone() }); }