Skip to content

Running out of category colors #56

Open

Description

@AtomicMaya

Describe the bug
If you have more than 10 challenge categories, the pie chart runs out of colors.

To Reproduce
Steps to reproduce the behavior:

  1. Create 11 categories
  2. Go to Admin/Statistics
  3. Check Challenges/Category
  4. See error

Expected behavior
Every category should have a color

Screenshots
image

Activity

  1. transferred this issue fromractf/coreon Oct 23, 2021
  2. NicholasG04 commented on Feb 7, 2022

    @NicholasG04
    Member

    https://github.com/ractf/ui-kit/blob/572429458c336d03273e4e20cc154389f873cf7f/components/charts/common.js
    Not sure of ideal way to fix this, the colours are hardcoded right now.

  3. AtomicMaya commented on Feb 8, 2022

    @AtomicMaya
    Author

    This could maybe be done by looping on the color array and applying a brightness or darkness color lerp?

    eg: [0, ..., 9, darken(0), ...]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions