diff --git a/nafuma/plotting.py b/nafuma/plotting.py index 6d9bf09..c0105b5 100644 --- a/nafuma/plotting.py +++ b/nafuma/plotting.py @@ -485,4 +485,30 @@ def make_animation(paths, options={}): frames[0].save(os.path.join(options['save_folder'], options['save_filename']), format='GIF', append_images=frames[1:], save_all=True, duration=(1/options['fps'])*1000, loop=0) - \ No newline at end of file + + + +def mix_colours(colour1, colour2, options): + + default_options = { + 'number_of_colours': 10, + 'weights': None + } + + options = aux.update_options(options=options, default_options=default_options) + + if not options['weights']: + options['weights'] = [x/options['number_of_colours'] for x in range(options['number_of_colours'])] + + colours = [] + for weight in options['weights']: + colour = [] + + for c1, c2 in zip(colour1, colour2): + colour.append(np.round(((1-weight)*c1 + weight*c2), 5)) + + colours.append(colour) + + + return colours + \ No newline at end of file