| 发表于:2007-03-21 13:49:242楼 得分:0 |
//计算各个色值平均差值,即颜色相似度 public function colorspace(byval a as color, byval b as color) as double colorspace = (math.abs(0.0 + a.r - b.r) + math.abs(0.0 + a.g - b.g) + math.abs(0.0 + a.b - b.b)) / 3.0 end function private sub button1_click(byval sender as system.object, byval e as system.eventargs) handles button1.click text = colorspace(color.red, color.maroon) end sub | | |
|