How to make dynamic css colours in flask

Solution
@app.route('/dashboard')
def dashboard():

    items=[
        {'grade':0,'colour':(0,0,0)},
        {'grade':10, 'colour':(0,0,0)},
        {'grade':5, 'colour':(0,0,0)}
    ]
    
    for item in items:
        green = item['grade'] * 25.5
        red = 255 - green 
        item['colour'] = (red,green,0)
    
    return render_template('dashboard.html', **locals())
{% for item in items %}

{{ item.grade }}

{% endfor %}