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

13
LINES

< > BotCompany Repo | #1032090 // withAlpha - synonym of colorWithAlpha

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

Libraryless. Click here for Pure Java version (7958L/44K).

1  
static Color withAlpha(Color c, double alpha) {
2  
  ret colorWithAlpha(c, alpha);
3  
}
4  
5  
6  
7  
static Color withAlpha(double alpha, Color c) {
8  
  ret colorWithAlpha(alpha, c);
9  
}
10  
11  
static int withAlpha(double alpha, int rgb) {
12  
  ret rgb & 0xFFFFFF | (iround(clampToZeroOne(alpha)*255) << 24);
13  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032090
Snippet name: withAlpha - synonym of colorWithAlpha
Eternal ID of this version: #1032090/2
Text MD5: 177f73bdb2af2cea5e66f4143168e897
Transpilation MD5: 97ccfa2f96074e66cc739178812f50b7
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-04-29 01:40:21
Source code size: 293 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 185 / 272
Version history: 1 change(s)
Referenced in: [show references]