<jupyter_start><jupyter_text>home-made color gradients<jupyter_code>import numpy as np
import slfractals as slf
from slfractals.colors import BezierSpline, BernsteinPoly, ColorGradient

polys = BernsteinPoly.all_polynomials(3)
t = np.linspace(0, 1, 10)

control_points = np.array([(0.5,0), (1.5,0), (1.5,0), (1, 1), (2, 2)])
# control_points = np.random.rand(4, 2)
control_points 
bs = BezierSpline(control_points)
vals = bs.calculate(n_discr=100)

fig = figure(match_aspect=True)
fig.circle(x=bs.p[:, 0], y=bs.p[:, 1], size=7)
fig.line(x=vals[:, 0], y=vals[:, 1])
show(fig)

hex(123,)
colors = ["#000000", "#ff0000", "00ff00"]
cg = ColorGradient(colors)
cg.remove_hashtag(colors)

cg(10)


from bokeh.palettes import inferno
inferno(19)
from matplotlib import cm
cm.hot<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16625, 'fraction_numerical': 0.06125, 'mean_word_length': 6.628571428571429, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '664770', 'license': 'MIT', 'n_tokens_mistral': 366, 'n_tokens_neox': 333, 'n_words': 69, 'path': 'notebooks/experiments-3-colors.ipynb', 'repo_name': 'scherbertlemon/slfractals', 'size': '800'}