Let's say I have a palette of n colors and I want to mix all colors with a specific weight assigned to each color. Think of the weight as the percent of ink I want to take from each color. For simplification, let's use 3 primary colors:
palette = [(1,0,0),(0,1,0),(0,0,1)]
weight = (0.1,0.1,0.1)
Naturally, the least amount of ink will lead to lighter color. So if I use 10% of each ink, I would expect somewhat closer to white color. But it's not the case in the rgb color scheme:
import numpy as np
import matplotlib.colors as colors
mixed_colors = np.sum([np.multiply(weight[i],palette[i]) for i in range(len(palette))],axis=1)
print(colors.to_hex(mixed_colors))
In this case, I would get #1a1a1a
which is closer to the black color. How can I perform weighted sum with the weight represent the "amount of ink" for each color?
For now, please ignore the fact that the weighted summation can result in number greater than 1 for each rgb field.