mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2024-12-16 15:48:13 +08:00
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:
parent
7de29687eb
commit
5a10127c1c
@ -3,6 +3,7 @@ This part lists all PUBLIC individuals having contributed content to the code.
|
||||
|
||||
* M M Arif (mmarif)
|
||||
* 6543
|
||||
* opyale
|
||||
* Unpublished
|
||||
|
||||
# Translators
|
||||
|
@ -33,7 +33,22 @@ public class ColorInverter {
|
||||
if(imageView != null) {
|
||||
|
||||
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 {
|
||||
|
@ -17,7 +17,7 @@ import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Author anonTree1417
|
||||
* Author opyale
|
||||
*/
|
||||
|
||||
public class PicassoCache implements Cache {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package org.mian.gitnex.helpers.ssl;
|
||||
|
||||
/**
|
||||
* Author Georg Lukas, modified by anonTree1417
|
||||
* Author Georg Lukas, modified by opyale
|
||||
*/
|
||||
|
||||
class MTMDecision {
|
||||
|
@ -7,7 +7,7 @@ import android.os.Bundle;
|
||||
import org.mian.gitnex.R;
|
||||
|
||||
/**
|
||||
* Author Georg Lukas, modified by anonTree1417
|
||||
* Author Georg Lukas, modified by opyale
|
||||
*/
|
||||
|
||||
public class MemorizingActivity extends Activity {
|
||||
@ -41,4 +41,4 @@ public class MemorizingActivity extends Activity {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ import javax.net.ssl.TrustManagerFactory;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
|
||||
/**
|
||||
* Author Georg Lukas, modified by anonTree1417
|
||||
* Author Georg Lukas, modified by opyale
|
||||
*/
|
||||
|
||||
public class MemorizingTrustManager implements X509TrustManager {
|
||||
|
Loading…
Reference in New Issue
Block a user