예제 #1
0
        public static Color NameToColor(string name)
        {
            uint hashVal = (uint)name.GetHashCode();

            hashVal = ((hashVal) & 0xff) ^ ((hashVal >> 8) & 0xff) ^ ((hashVal >> 16) & 0xff) ^ ((hashVal >> 24) & 0xff);
            var h = ((hashVal) & 0xffff) / 255.0;

            return(CodeUIItem.HSLToRGB(h, 0.8, 0.8));
        }
예제 #2
0
        public static Color NameToColor(string name)
        {
            uint hashVal = (uint)name.GetHashCode();
            var  h       = ((hashVal) & 0xffff) / 65535.0;
            var  s       = ((hashVal >> 16) & 0xff) / 255.0;
            var  l       = ((hashVal >> 24) & 0xff) / 255.0;

            return(CodeUIItem.HSLToRGB(h, 0.7 + s * 0.2, 0.75 + l * 0.15));
        }