Exemple #1
0
        private string GetValueString(Color color, Vector4 hsvColor)
        {
            var hue        = (uint)Math.Round(Hsv.GetHue(hsvColor));
            var saturation = (uint)Math.Round(Hsv.GetSaturation(hsvColor) * 100);
            var value      = (uint)Math.Round(Hsv.GetValue(hsvColor) * 100);

            if (DownlevelHelper.ToDisplayNameExists())
            {
                return(StringUtil.FormatString(
                           ResourceAccessor.GetLocalizedStringResource(ResourceAccessor.SR_ValueStringColorSpectrumWithColorName),
                           ColorHelper.ToDisplayName(color),
                           hue, saturation, value));
            }
            else
            {
                return(StringUtil.FormatString(
                           ResourceAccessor.GetLocalizedStringResource(ResourceAccessor.SR_ValueStringColorSpectrumWithoutColorName),
                           hue, saturation, value));
            }
        }