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

18
LINES

< > BotCompany Repo | #1035604 // rgbToHi15

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

Libraryless. Click here for Pure Java version (9406L/51K).

1  
static short rgbToHi15(RGB rgb) {
2  
  ret rgbIntToHi15(rgb.asInt());
3  
}
4  
5  
static short rgbToHi15(Color color) {
6  
  ret rgbIntToHi15(colorToInt(color));
7  
}
8  
9  
static short rgbToHi15(int rgb) {
10  
  ret rgbIntToHi15(rgb);
11  
}
12  
13  
static short rgbToHi15(int r, int g, int b) {
14  
  r >>= 3;
15  
  g >>= 3;
16  
  b >>= 3;
17  
  ret (short) ((r << 10) | (g << 5) | b);
18  
}

Author comment

Began life as a copy of #1035587

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): elmgxqgtpvxh, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035604
Snippet name: rgbToHi15
Eternal ID of this version: #1035604/5
Text MD5: cd8b89a06a300723915263985b95309b
Transpilation MD5: cb1feddcb85e628b9d336d33a139e6e0
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-08-05 22:24:00
Source code size: 351 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 163 / 213
Version history: 4 change(s)
Referenced in: [show references]