Libraryless. Click here for Pure Java version (137L/1K).
1 | static float alternativeSaturationFromRGB_1(int rgb) {
|
2 | int r = (rgb >> 16) & 0xFF; |
3 | int g = (rgb >> 8) & 0xFF; |
4 | int b = rgb & 0xFF; |
5 | double brightness = (r+g+b)/255.0; |
6 | double factor = abs(brightness-0.5)*2; |
7 | ret (float) (saturationFromRGB(rgb)*factor); |
8 | } |
Began life as a copy of #1020181
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: | #1024728 |
| Snippet name: | alternativeSaturationFromRGB_1 - lower saturation for very bright and dark colors |
| Eternal ID of this version: | #1024728/2 |
| Text MD5: | 0d338195dc3ab39ea644af8cadb274ea |
| Transpilation MD5: | fcc3357c242958b627d8f65c33be51dc |
| Author: | stefan |
| Category: | javax / imaging |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-08-24 14:51:50 |
| Source code size: | 269 bytes / 8 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 465 / 582 |
| Version history: | 1 change(s) |
| Referenced in: | [show references] |