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

14
LINES

< > BotCompany Repo | #1033813 // withOpacity - extended synonym of colorWithAlpha

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

Libraryless. Click here for Pure Java version (73L/1K).

1  
static Color withOpacity(Color c, double alpha) {
2  
  ret colorWithAlpha(c, alpha);
3  
}
4  
5  
6  
7  
static Color withOpacity(double alpha, Color c) {
8  
  ret colorWithAlpha(alpha, c);
9  
}
10  
11  
// opacity = 0 to 255
12  
static int withOpacity(int opacity, int rgb) {
13  
  ret (opacity << 24) | (rgb & 0xFFFFFF);
14  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1033813
Snippet name: withOpacity - extended synonym of colorWithAlpha
Eternal ID of this version: #1033813/3
Text MD5: 9921b7d4e54c74939ff429b9e4acffc2
Transpilation MD5: f308e92926b3add840b3cfd1fb416df4
Author: someone
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-07-17 19:02:58
Source code size: 297 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 102 / 158
Version history: 2 change(s)
Referenced in: [show references]