U: CEF ARGB

This commit is contained in:
杨红岩 2023-06-19 18:47:54 +08:00
parent 0f9d9554e9
commit 3114f87432

View File

@ -188,6 +188,22 @@ func CefCursorToWindowsCursor(cefCursor consts.TCefCursorType) (result t.TCursor
return
}
func CefColorSetARGB(a, r, g, b byte) types.TCefColor {
return types.TCefColor((a >> 24) | (r >> 16) | (g >> 8) | b)
func CefColorGetA(color types.TCefColor) uint8 {
return uint8(color>>24) & 0xFF
}
func CefColorGetR(color types.TCefColor) uint8 {
return uint8(color>>16) & 0xFF
}
func CefColorGetG(color types.TCefColor) uint8 {
return uint8(color>>8) & 0xFF
}
func CefColorGetB(color types.TCefColor) uint8 {
return uint8(color) & 0xFF
}
func CefColorSetARGB(a, r, g, b byte) types.TCefColor {
return types.TCefColor((uint32(a) << 24) | (uint32(r) << 16) | (uint32(g) << 8) | (uint32(b)))
}