整数转COLOR一方法
简介:
private Color getColor(int index)
{
Color clr;
/* 红色 */
...
- private Color getColor(int index)
- {
- Color clr;
- /* 红色 */
- int rValue = 255;
- int gValue = 40;
- int bValue = 40;
-
- string rValueStr = Convert.ToString(rValue , 16);
- string gValueStr = Convert.ToString(gValue + index +4 , 16);
- string bValueStr = Convert.ToString(bValue + index + 4, 16);
-
- string rgbValueStr = string.Format("#{0}{1}{2}", rValueStr, gValueStr, bValueStr);
- clr = System.Drawing.ColorTranslator.FromHtml(rgbValueStr);
- return clr;
- }