static double saturationFromRGB(int rgb) { int r = (rgb >> 16) & 0xFF; int g = (rgb >> 8) & 0xFF; int b = rgb & 0xFF; int min = min(min(r, g), b); int max = max(max(r, g), b); ret max != 0 ? (max-min) / (double) max : 0; }
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1020181 |
Snippet name: | saturationFromRGB |
Eternal ID of this version: | #1020181/2 |
Text MD5: | ebc10f123c8f3a00cfc3594514d4047d |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-12-09 21:07:10 |
Source code size: | 241 bytes / 8 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 335 / 369 |
Version history: | 1 change(s) |
Referenced in: | [show references] |