From 5a10127c1cec95600ab2762a3c66c5239cf27a70 Mon Sep 17 00:00:00 2001 From: opyale Date: Tue, 23 Jun 2020 16:54:27 +0200 Subject: [PATCH] Calculate ImageContrastColor more precise & some doc nits (#544) Fixing color bug, updating license headers and CONTRIBUTORS Co-authored-by: opyale Reviewed-by: 6543 <6543@noreply.codeberg.org> Reviewed-by: M M Arif --- CONTRIBUTORS.md | 1 + .../org/mian/gitnex/helpers/ColorInverter.java | 17 ++++++++++++++++- .../org/mian/gitnex/helpers/PicassoCache.java | 2 +- .../mian/gitnex/helpers/ssl/MTMDecision.java | 2 +- .../gitnex/helpers/ssl/MemorizingActivity.java | 4 ++-- .../helpers/ssl/MemorizingTrustManager.java | 2 +- 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 821f3b75..73b19345 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -3,6 +3,7 @@ This part lists all PUBLIC individuals having contributed content to the code. * M M Arif (mmarif) * 6543 + * opyale * Unpublished # Translators diff --git a/app/src/main/java/org/mian/gitnex/helpers/ColorInverter.java b/app/src/main/java/org/mian/gitnex/helpers/ColorInverter.java index 4eea5dac..e1f16d79 100644 --- a/app/src/main/java/org/mian/gitnex/helpers/ColorInverter.java +++ b/app/src/main/java/org/mian/gitnex/helpers/ColorInverter.java @@ -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