怎么把十六进制的颜色字符串转化为十进制的字符串,如"#0000ff"到"255"

解决方案 »

  1.   

    #0000ff --> 0000fe --> [0][0][0][0][15][14] -->
    计算:
    14*16(0) + 15*16(1) + 0*16(2) + 0*16(3) + 0*16(4) + 0*16(5)=254
    16(0) 表示16的0次幂
      

  2.   

    #0000fe --> 0000fe --> [0][0][0][0][15][14] -->
    计算:
    14*16(0) + 15*16(1) + 0*16(2) + 0*16(3) + 0*16(4) + 0*16(5)=254
    16(0) 表示16的0次幂
      

  3.   

    int i = int.Parse("0000ff",System.Globalization.NumberStyles.HexNumber);
      

  4.   

    http://community.csdn.net/Expert/topic/3321/3321685.xml?temp=.6727259