Using the statistics module wasn't worth it, because of the time needed for import.

This commit is contained in:
Andrew Hamilton 2016-02-07 13:03:21 +00:00
parent d03e4bd0fe
commit c00d5bea36

3
vigil
View file

@ -61,7 +61,6 @@ import os
import pickle import pickle
import shutil import shutil
import signal import signal
import statistics
import subprocess import subprocess
import sys import sys
import tempfile import tempfile
@ -235,7 +234,7 @@ class Entry(collections.UserList):
result_selected.status, None) result_selected.status, None)
fg_color = (termstr.Color.white fg_color = (termstr.Color.white
if (status_color is None if (status_color is None
or statistics.mean(status_color) < (255 / 2)) or (sum(status_color) / 3) < (255 / 2))
else termstr.Color.black) else termstr.Color.black)
return fill3.Text(termstr.TermStr("●", termstr.CharStyle( return fill3.Text(termstr.TermStr("●", termstr.CharStyle(
fg_color=fg_color, bg_color=status_color))) fg_color=fg_color, bg_color=status_color)))