I have various objects in my database identified by unique System.Guid's
. When I display them, I would like each of them to have a unique color based on their guid.
So I want something like this:
public Color ColorFromGuid(Guid guid) { /* ?? */ }
Where
ColorFromGuid(databaseObject1.Guid) == ColorFromGuid(databaseObject1.Guid)
ColorFromGuid(databaseObject2.Guid) == ColorFromGuid(databaseObject2.Guid)
ColorFromGuid(databaseObject1.Guid) != ColorFromGuid(databaseObject2.Guid)
What would be the best way to do this?
EDIT Obviously there are WAY more unique guids than colors, so there's no way that every guid will have it's own unique color. I'm just looking for a good variety.