Skip to content

Color scales for 7 and 9 option answers #75

@olehermanse

Description

@olehermanse

Can someone make a scale of colors (hex) from green (good) to red (bad) with 7 and 9 points, for our new questions?

I added some temporary ones in #74 :

    # TODO: Define 7 and 9 color scale
    if len(answers) == 9:
        colors = "['#00ff00', '#44ff00', '#88ff00', '#ccff00', '#ffff00', '#ffcc00', '#ff8800', '#ff4400', '#ff0000']"
    elif len(answers) == 7:
        colors = "['#00ff00', '#66ff00', '#ccff00', '#ffff00', '#ffcc00', '#ff6600', '#ff0000']"
    elif len(answers) == 6:
        colors = "['#1a9850', '#91cf60', '#d9ef8b', '#fee08b', '#fc8d59', '#d73027']"
    elif len(answers) == 5:
        colors = "['#d7191c', '#fdae61', '#91cf60', '#abd9e9', '#2c7bb6']"
    else:
        print("Warning: Chart for '{}' omitted. No colors defined for questions with {} alternatives".format(
            question, len(answers)))
        return ''

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions