The following approach uses a ListedColormap. The ratios are multiplied by some sufficiently large factor, rounded and used as a repetition factor.
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
import numpy as np
colors = [[0.70248465, 0.10704011, 0.00900125], [0.0067905, 0.27228963, 0.6428365], [0.00859376, 0.36948201, 0.18334154], [0.85125032, 0.65469019, 0.04035713]]
ratios = [1, 1/2, 1/3, 1/5]
ratios_int = (np.array(ratios) * 60).round().astype(int)
plt.imshow(np.repeat(np.arange(len(colors)), ratios_int).reshape(1, -1),
cmap=ListedColormap(colors), # the given list of colors
aspect=ratios_int.sum()/10) # 1:10 aspect ratio for the image
plt.axis('off')
plt.show()

ratio_int is an array with only integers, but which have similar ratios as the given fractional ratios. If all the denominators are integers, one could multiply by the smallest common multiple of the denominators. In the example, 60 is used as a multiplier. In general, with fractions that wouldn't be expressible as ratios between small integers, a sufficiently large multiplier would do the job. Even if this would generate a small difference between the exact ratios, such small difference wouldn't be notable in the resulting image.
np.arange(len(colors)) gives an array 0,1,2,3,.... Matplotlib's color mapping will map these to the corresponding color in the ListedColormap. np.repeat([0,1,2,3], [60,30,20,12]) will repeat 0 for 60 times, 1 for 30, etc. So, this will create an array with each number repeated corresponding to the given ratios. .reshape(1,-1) converts this 1D array to a 2D array suitable for imshow. The first dimension is 1, and the second equal to the length of the 1D array (-1 means "take as much as needed such that the initial array and the reshaped array have the same number of elements").