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).

static Color blendColors(double bish, Color a, Color b) {
  ret blendColors(a, b, bish);
}

static Color blendColors(Color a, Color b, double bish) {
  bish = clampZeroToOne(bish);
  ret new Color(
    (float) blend(a.getRed()/255.0, b.getRed()/255.0, bish),
    (float) blend(a.getGreen()/255.0, b.getGreen()/255.0, bish),
    (float) blend(a.getBlue()/255.0, b.getBlue()/255.0, bish));
}

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: 545 / 621
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1008003 - blendColor - synonym of blendColors
#1029770 - addColors
#1031376 - rgbAdd
#1034859 - blendMultipleColors
#1035297 - blendRGBInts - no alpha