.RGB转Lab的VB代码在网上搜索了很久,也没有看到用VB写的RGB转Lab的代码,现根据网上通用的转换算法改写成VB代码(转换后与CIE-Lab的标准色卡有差异,附色卡Lab与RGB对照表),希望能抛砖引玉。代码如下:RGB转LabSub RGB_Lab(R1, G1, B1 As Long, L, A, B As Currency) R1,G1,B1为颜色三分量值,先赋值 Dim R2, G2, B2, X1, Y1, Z1 As Currency R2 = R1 / 255 G2 = G1 / 255 B2 = B1 / 255 If R2 0.04045 Then R2 = (R2 + 0.055) / 1.055) 2.4 Else R2 = R2 / 12.92 If G2 0.04045 Then G2 = (G2 + 0.055) / 1.055) 2.4 Else G2 = G2 / 12.92 If B2 0.04045 Then B2