- '//取各颜色分量
- Public Function GetRedValue(COLOR As Long) As Integer '取得红色值
- GetRedValue = COLOR And
- End Function
- Public Function GetGreenValue(COLOR As Long) As Integer '取得绿色值
- GetGreenValue = (COLOR And 65280) / 256
- End Function
- Public Function GetBlueValue(COLOR As Long) As Integer '取得蓝色值
- GetBlueValue = (COLOR And &HFF0000) / 65536
- End Function
- '//将RGB转化为HTML颜色.
- Public Function GetHexColor(Red As Integer, Green As Integer, Blue As Integer) As String
- '将RGB颜色转换为HTML颜色
- Dim StrRed As String, StrGreen As String, StrBlue As String
- StrRed = Hex(Red)
- StrGreen = Hex(Green)
- StrBlue = Hex(Blue)
- If Red <= 16 Then StrRed = "0" & StrRed
- If Green <= 16 Then StrGreen = "0" & StrGreen
- If Blue <= 16 Then StrBlue = "0" & StrBlue
- GetHexColor = StrRed & StrGreen & StrBlue
- End Function
VB取各颜色分量,将RGB转为HTML颜色.
最新推荐文章于 2022-07-03 12:30:00 发布