wpf - C#.Net Unspecified String to Color Converter -
in situation have list of customers represent colors. how make converter generate color based off customer name, or portion of name? public class customer { public string customername {get; set;} //other properties unrelated question.... } then in xaml somewhere able following: <textblock text="{binding customername}" foreground="{binding customername, converter={staticresource mystringtocolorconverter}}"/> i don't need whole converter written out, ideas on how convert unspecified string color. you take binary values of first 3 characters of name , convert red, green, , blue values. thing though regular names begin (assuming upper case characters) 26 of 256 possible binary values you'll need adding , multiplying in 0-1 range. if want more 26 discrete values each of red, green, , blue consider aggregating value multiple letters. once have number in 0-1 range, next thing want normalize values avoid ...