{"version":"1.0","type":"rich","title":"A small Python script to generate random color sequences, e.g. for use in plotting. Just call the \"generate_new_color(existing_colors,pastel_factor)\" function to generate a random color that is (statistically) maximally different from all colors in \"existing_colors\". The \"pastel_factor\" parameter can be used to specify the \"pasteliness\"(?) of the produced colors (please, don't you chose 0...)","description":"This example demonstrates a Python utility for generating a sequence of visually distinct random colors, suitable for plotting or data visualization. It shows how to produce colors that are maximally different from a set of existing colors, with a `pastel_factor` parameter controlling pastel softness. The script uses Python’s `random` module to sample candidate RGB values and computes a simple Manhattan-distance metric (`color_distance`) to select the best candidate. The main function, `generate_new_color`, iterates 100 times to find the color with the greatest minimum distance from all previously chosen colors, with the example loop generating ten colors.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-5884820?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}