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

8
LINES

< > BotCompany Repo | #1025272 // colorSimilarity - 1-colorDistance

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

Libraryless. Click here for Pure Java version (2250L/14K).

static float colorSimilarity(RGB a, RGB b) {
  ret 1-colorDistance(a, b);
}

// 0xRRGGBB - result is between 0 and 1
static float colorSimilarity(int a, int b) {
  ret 1-colorDistance(a, b);
}

Author comment

Began life as a copy of #1025271

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1025272
Snippet name: colorSimilarity - 1-colorDistance
Eternal ID of this version: #1025272/1
Text MD5: 43dbdb1f74d4d35e3c3b28b0a3d9370f
Transpilation MD5: c3214647b0c1225471a2ac3d18644fa7
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-17 01:55:45
Source code size: 199 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 195 / 251
Referenced in: [show references]