获取Synopsys coverage report excel 文件单元格RGB值

打开生成的vplan反标后的xml文件,另存为xlsm,excel需要打开宏。

ALT+F11打开VBA编辑器, 选择 “插入”-》“模块”,复制如下代码,保存即可。

Public Function wRGB(rng As Range)
 Dim intColor As Long
 Dim rgb As String
 intColor = rng.Interior.Color
 r = Hex(intColor And 255)
 g = Hex(intColor \ 256 And 255)
 b = Hex(intColor \ 256 ^ 2 And 255)
 wRGB = r & "," & g & "," & b
End Function

然后在excel中即可使用wRGB函数获取对应的RGB值。

获取Synopsys coverage report excel 文件单元格RGB值_第1张图片

获取的RGB值,可以用于openpyxl自动生成表格时,设置对应的百分比对应的背景色。

你可能感兴趣的:(VCS,IC验证)