Skip to content

Commit

Permalink
minor update to arg name
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPatrie committed Aug 6, 2024
1 parent 9c77606 commit 574aab0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bio_check/processing_tools.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import numpy as np


def generate_color_gradient(simulator_names) -> list[str]:
"""Generate a gradient of colors from red to green to blue for a list of simulator names."""
num_simulators = len(simulator_names)
def generate_color_gradient(data_names) -> list[str]:
"""Generate a gradient of colors from red to green to blue for a list of data names."""
num_data = len(data_names)

red_to_green = np.linspace([1, 0, 0], [0, 1, 0], num=int(np.ceil(num_simulators / 2)), endpoint=False)
green_to_blue = np.linspace([0, 1, 0], [0, 0, 1], num=int(np.ceil(num_simulators / 2 + 1)))
red_to_green = np.linspace([1, 0, 0], [0, 1, 0], num=int(np.ceil(num_data / 2)), endpoint=False)
green_to_blue = np.linspace([0, 1, 0], [0, 0, 1], num=int(np.ceil(num_data / 2 + 1)))

full_gradient = np.vstack([red_to_green, green_to_blue])[1:num_simulators + 1]
full_gradient = np.vstack([red_to_green, green_to_blue])[1:num_data + 1]

hex_colors = ['#{:02x}{:02x}{:02x}'.format(int(r * 255), int(g * 255), int(b * 255)) for r, g, b in full_gradient]

Expand Down

0 comments on commit 574aab0

Please sign in to comment.