mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-31 22:26:06 +02:00
Added letter color treshold setting
This commit is contained in:
@@ -124,6 +124,7 @@ class ImageHelper {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
float s = prefs.getInt("saturation", 100) / 100f;
|
||||
float v = prefs.getInt("brightness", 100) / 100f;
|
||||
float t = prefs.getInt("threshold", 50) / 100f;
|
||||
|
||||
int bg = Color.HSVToColor(new float[]{h, s, v});
|
||||
double lum = ColorUtils.calculateLuminance(bg);
|
||||
@@ -133,7 +134,7 @@ class ImageHelper {
|
||||
canvas.drawColor(bg);
|
||||
|
||||
Paint paint = new Paint();
|
||||
paint.setColor(lum < 0.5 ? Color.WHITE : Color.BLACK);
|
||||
paint.setColor(lum < t ? Color.WHITE : Color.BLACK);
|
||||
paint.setTextSize(size / 2f);
|
||||
paint.setTypeface(Typeface.DEFAULT_BOLD);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user