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

17
LINES

< > BotCompany Repo | #1014940 // toColor

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

Libraryless. Click here for Pure Java version (8066L/45K).

1  
ifclass RGB
2  
static Color toColor(RGB rgb) {
3  
  ret rgb == null ? null : rgb.getColor();
4  
}
5  
endif
6  
7  
static Color toColor(int rgb) {
8  
  ret new Color(rgb);
9  
}
10  
11  
static Color toColor(S hex) {
12  
  ret awtColor(hex);
13  
}
14  
15  
static Color toColor(int[] rgb) {
16  
  ret new Color(rgb[0], rgb[1], rgb[2]);
17  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1014940
Snippet name: toColor
Eternal ID of this version: #1014940/5
Text MD5: f198220a96206b09e8c6d6c0fa764f27
Transpilation MD5: 6f90218ef6b547e76d4aadf148c5e3e4
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-09 19:48:15
Source code size: 299 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 551 / 710
Version history: 4 change(s)
Referenced in: [show references]