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

10
LINES

< > BotCompany Repo | #1004269 // colorWithAlpha - 0=transparent, 1=opaque

JavaX fragment (include)

1  
static Color colorWithAlpha(Color c, double alpha) {
2  
  ret new Color(c.getRed()/255f,
3  
    c.getGreen()/255f,
4  
    c.getBlue()/255f,
5  
    (float) clampZeroToOne(alpha));
6  
}
7  
8  
static Color colorWithAlpha(double alpha, Color c) {
9  
  ret colorWithAlpha(c, alpha);
10  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1004269
Snippet name: colorWithAlpha - 0=transparent, 1=opaque
Eternal ID of this version: #1004269/6
Text MD5: c517dce6150c32ea0ea90de62ae58f13
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-20 09:33:05
Source code size: 265 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 632 / 667
Version history: 5 change(s)
Referenced in: [show references]