|
|
@ -3,9 +3,14 @@ from typing import List |
|
|
|
import matplotlib.colors as mcolors |
|
|
|
import matplotlib.pyplot as plt |
|
|
|
import numpy as np |
|
|
|
from matplotlib.font_manager import FontProperties |
|
|
|
|
|
|
|
pt_mono_font = FontProperties( |
|
|
|
fname="/usr/share/fonts/truetype/PT_Mono/PTMono-Regular.ttf" |
|
|
|
) |
|
|
|
|
|
|
|
# set font by default to courier new |
|
|
|
plt.rcParams["font.family"] = "PT Mono" |
|
|
|
# plt.rcParams["font.family"] = "PT Mono" |
|
|
|
# # sort by the proximity to the colors in viridis |
|
|
|
# # Importing necessary functions |
|
|
|
|
|
|
@ -63,6 +68,7 @@ def create_color_calibration_image( |
|
|
|
color.replace("xkcd:", ""), |
|
|
|
va="center", |
|
|
|
fontsize=fontsize, |
|
|
|
fontproperties=pt_mono_font, |
|
|
|
# bbox=dict(facecolor='gray', alpha=0.21), |
|
|
|
) |
|
|
|
ax.text( |
|
|
@ -71,6 +77,7 @@ def create_color_calibration_image( |
|
|
|
f"{hex_code}\n({rgb_triple})", |
|
|
|
va="center", |
|
|
|
fontsize=6, |
|
|
|
fontproperties=pt_mono_font, |
|
|
|
# bbox=dict(facecolor='gray', alpha=0.33), |
|
|
|
) |
|
|
|
# ax.text( |
|
|
@ -79,6 +86,7 @@ def create_color_calibration_image( |
|
|
|
# f"{hex_code}", |
|
|
|
# va="center", |
|
|
|
# fontsize=fontsize * 0.6, |
|
|
|
# fontproperties=pt_mono_font, |
|
|
|
# ) |
|
|
|
|
|
|
|
# Draw color square |
|
|
@ -160,7 +168,7 @@ if __name__ == "__main__": |
|
|
|
"--rows", type=int, default=73, help="Number of entries per column" |
|
|
|
) |
|
|
|
parser.add_argument( |
|
|
|
"--dir", type=str, default="/Volumes/TMP/tests", help="Directory to save images" |
|
|
|
"--dir", type=str, default="~/color/out", help="Directory to save images" |
|
|
|
) |
|
|
|
parser.add_argument( |
|
|
|
"-k", |
|
|
|