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

17
LINES

< > BotCompany Repo | #1014981 // CircleWithColor

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (5814L/32K).

1  
sclass CircleWithColor implements RenderableWithHints {
2  
  Pt center;
3  
  int r;
4  
  RGB color;
5  
  
6  
  *() {}
7  
  *(Pt *center, int *r, RGB *color) {}
8  
  *(Pt *center, int *r, Color color) { this.color = new RGB(color); }
9  
  
10  
  public void renderOn(Graphics2D g, int w, int h) {
11  
    fillCircle(g, center.x, center.y, r, toColor(color));
12  
  }
13  
  
14  
  public void renderHints(Graphics2D g, int w, int h) {
15  
    drawCircle(g, center.x, center.y, r, colorWithAlpha(0.5, Color.black));
16  
  }
17  
}

Author comment

Began life as a copy of #1014967

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1014981
Snippet name: CircleWithColor
Eternal ID of this version: #1014981/5
Text MD5: 96e857b5e7568b6ebcecd3ae9c71197e
Transpilation MD5: c926c867235f457f207f1e61dc58ee77
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-02-05 02:53:22
Source code size: 488 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 461 / 1075
Version history: 4 change(s)
Referenced in: [show references]