Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #1006202 // Color Picker [pick up color from screen on mouse click]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (6850L/50K/176K).

1  
!7
2  
3  
p {
4  
  trackOneClick(voidfunc(final Point p) {
5  
    awtLater(500, r {
6  
      RGBImage img = shootScreen(new Rect(p.x, p.y, 1, 1));
7  
      RGB rgb = img.getPixel(0, 0);
8  
      print("Color at " + p.x + "/" + p.y + ": #" + rgb + " " + rgbToIntTriple(rgb));
9  
      showControls(jCenteredLine(jbutton("Do it again", r { callMain(mc()) })));
10  
    });
11  
  });
12  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006202
Snippet name: Color Picker [pick up color from screen on mouse click]
Eternal ID of this version: #1006202/5
Text MD5: 1fc5648e9cc0c41df99633edc5abe56a
Transpilation MD5: 0e6e16d101860835999007a2edda710e
Author: stefan
Category: javax / gui
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-18 13:37:54
Source code size: 361 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 509 / 654
Version history: 4 change(s)
Referenced in: [show references]