import numpy as np
class ColorDtype():
def __new__(cls):
return np.dtype([
('R', np.uint8),
('G', np.uint8),
('B', np.uint8),
('A', np.uint8)
])
# Create a Numpy array of RGBA colors using the custom dtype
colors = np.array([(255, 0, 0, 255), (0, 255, 0, 255), (0, 0, 255, 255)], dtype=ColorDtype())
print(colors)