Calculate ImageContrastColor more precise & some doc nits (#544)

Fixing color bug, updating license headers and CONTRIBUTORS

Co-authored-by: opyale <opyale@noreply.gitea.io>
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
This commit is contained in:
opyale 2020-06-23 16:54:27 +02:00 committed by M M Arif
parent 7de29687eb
commit 5a10127c1c
6 changed files with 22 additions and 6 deletions

View File

@ -3,6 +3,7 @@ This part lists all PUBLIC individuals having contributed content to the code.
* M M Arif (mmarif) * M M Arif (mmarif)
* 6543 * 6543
* opyale
* Unpublished * Unpublished
# Translators # Translators

View File

@ -33,7 +33,22 @@ public class ColorInverter {
if(imageView != null) { if(imageView != null) {
Bitmap bitmap = ((BitmapDrawable) imageView.getDrawable()).getBitmap(); Bitmap bitmap = ((BitmapDrawable) imageView.getDrawable()).getBitmap();
return getContrastColor(bitmap.getPixel(bitmap.getWidth() / 2, bitmap.getHeight() / 2));
int colorSum = 0;
int divisionValue = 0;
for(int height=0; height<bitmap.getHeight(); height += 10) {
for(int width=0; width<bitmap.getWidth(); width += 10) {
colorSum += bitmap.getPixel(width, height);
divisionValue++;
}
}
// Calculate average color
return getContrastColor(colorSum / divisionValue);
} }
else { else {

View File

@ -17,7 +17,7 @@ import java.util.Map;
import java.util.UUID; import java.util.UUID;
/** /**
* Author anonTree1417 * Author opyale
*/ */
public class PicassoCache implements Cache { public class PicassoCache implements Cache {

View File

@ -1,7 +1,7 @@
package org.mian.gitnex.helpers.ssl; package org.mian.gitnex.helpers.ssl;
/** /**
* Author Georg Lukas, modified by anonTree1417 * Author Georg Lukas, modified by opyale
*/ */
class MTMDecision { class MTMDecision {

View File

@ -7,7 +7,7 @@ import android.os.Bundle;
import org.mian.gitnex.R; import org.mian.gitnex.R;
/** /**
* Author Georg Lukas, modified by anonTree1417 * Author Georg Lukas, modified by opyale
*/ */
public class MemorizingActivity extends Activity { public class MemorizingActivity extends Activity {

View File

@ -39,7 +39,7 @@ import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager; import javax.net.ssl.X509TrustManager;
/** /**
* Author Georg Lukas, modified by anonTree1417 * Author Georg Lukas, modified by opyale
*/ */
public class MemorizingTrustManager implements X509TrustManager { public class MemorizingTrustManager implements X509TrustManager {