mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-02 23:23:55 +00:00
add more color examples
This commit is contained in:
parent
4f85eb5056
commit
e0fb010ae1
@ -125,8 +125,20 @@ func screen() {
|
|||||||
// gets the pixel color at 100, 200.
|
// gets the pixel color at 100, 200.
|
||||||
color := robotgo.GetPixelColor(100, 200)
|
color := robotgo.GetPixelColor(100, 200)
|
||||||
fmt.Println("color----", color, "-----------------")
|
fmt.Println("color----", color, "-----------------")
|
||||||
|
|
||||||
clo := robotgo.GetPxColor(100, 200)
|
clo := robotgo.GetPxColor(100, 200)
|
||||||
fmt.Println("color...", clo)
|
fmt.Println("color...", clo)
|
||||||
|
clostr := robotgo.PadHex(clo)
|
||||||
|
fmt.Println("color...", clostr)
|
||||||
|
|
||||||
|
rgb := robotgo.RgbToHex(255, 100, 200)
|
||||||
|
rgbstr := robotgo.PadHex(robotgo.U32ToHex(rgb))
|
||||||
|
fmt.Println("rgb...", rgbstr)
|
||||||
|
|
||||||
|
hex := robotgo.HexToRgb(uint32(rgb))
|
||||||
|
fmt.Println("hex...", hex)
|
||||||
|
hexh := robotgo.PadHex(robotgo.U8ToHex(hex))
|
||||||
|
fmt.Println("HexToRgb...", hexh)
|
||||||
|
|
||||||
// gets the pixel color at 10, 20.
|
// gets the pixel color at 10, 20.
|
||||||
color2 := robotgo.GetPixelColor(10, 20)
|
color2 := robotgo.GetPixelColor(10, 20)
|
||||||
|
@ -38,8 +38,20 @@ func main() {
|
|||||||
// gets the pixel color at 100, 200.
|
// gets the pixel color at 100, 200.
|
||||||
color := robotgo.GetPixelColor(100, 200)
|
color := robotgo.GetPixelColor(100, 200)
|
||||||
fmt.Println("color----", color, "-----------------")
|
fmt.Println("color----", color, "-----------------")
|
||||||
|
|
||||||
clo := robotgo.GetPxColor(100, 200)
|
clo := robotgo.GetPxColor(100, 200)
|
||||||
fmt.Println("color...", clo)
|
fmt.Println("color...", clo)
|
||||||
|
clostr := robotgo.PadHex(clo)
|
||||||
|
fmt.Println("color...", clostr)
|
||||||
|
|
||||||
|
rgb := robotgo.RgbToHex(255, 100, 200)
|
||||||
|
rgbstr := robotgo.PadHex(robotgo.U32ToHex(rgb))
|
||||||
|
fmt.Println("rgb...", rgbstr)
|
||||||
|
|
||||||
|
hex := robotgo.HexToRgb(uint32(rgb))
|
||||||
|
fmt.Println("hex...", hex)
|
||||||
|
hexh := robotgo.PadHex(robotgo.U8ToHex(hex))
|
||||||
|
fmt.Println("HexToRgb...", hexh)
|
||||||
|
|
||||||
// gets the pixel color at 10, 20.
|
// gets the pixel color at 10, 20.
|
||||||
color2 := robotgo.GetPixelColor(10, 20)
|
color2 := robotgo.GetPixelColor(10, 20)
|
||||||
|
Loading…
Reference in New Issue
Block a user