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

11
LINES

< > BotCompany Repo | #1007920 // blendColors

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

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

1  
static Color blendColors(double bish, Color a, Color b) {
2  
  ret blendColors(a, b, bish);
3  
}
4  
5  
static Color blendColors(Color a, Color b, double bish) {
6  
  bish = clampZeroToOne(bish);
7  
  ret new Color(
8  
    (float) blend(a.getRed()/255.0, b.getRed()/255.0, bish),
9  
    (float) blend(a.getGreen()/255.0, b.getGreen()/255.0, bish),
10  
    (float) blend(a.getBlue()/255.0, b.getBlue()/255.0, bish));
11  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1007920
Snippet name: blendColors
Eternal ID of this version: #1007920/3
Text MD5: 357526cc04669dd8bf33af7eaa4c8386
Transpilation MD5: 59d872843798740b569ab1ae3d0c3c44
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-09-05 01:34:13
Source code size: 399 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 546 / 622
Version history: 2 change(s)
Referenced in: [show references]