Skip to content
Step 1: Start challenge
Premium
  • HTML
  • CSS
  • JS
intermediate

Color palette generator

Practice color math and JavaScript state with this palette generator, featuring five palette types, locked colors, one-click copying, and a live page preview.

Join 1 people who have taken this challenge

📝Brief

Your challenge is to build paintbox, a color palette generator that makes five-color palettes in five palette types, keeps the colors you lock, and copies any hex code in one click.

There's no API for this challenge. The starter code includes a data.json file with the first palette and the five palette types, and the README explains how each type makes its colors. You can use any tools you like to help you build it.

Your users should be able to:

  • Generate palettes
    • Make a new palette with the Generate button or the space bar
    • Lock any color so the next palette keeps it and is built around it
    • Pick a palette type: Random, Monochrome, Analogous, Complementary, or Triadic
  • Copy a hex code by clicking it
  • Preview the palette
    • See the colors on a sample web page, each with its own job
    • Keep generating and locking while in Preview
  • Undo and redo palettes
  • Copy the whole palette as CSS variables, hex codes, or a link
  • Keep the palette in the URL so a link opens the same colors
  • Switch the sample page to dark
  • Use the whole app with only a keyboard
  • View the optimal layout for the app depending on their device's screen size
  • See hover and focus states for all interactive elements on the page

Download the project and go through the README.md file. This will provide further details about the project and help you get set up.

Want some support on the challenge? Join our community and ask questions in the help channel.

🗃Assets provided

  • Figma design files
  • Mobile, tablet & desktop layouts
  • Professional design system for colors, fonts, etc.
  • Optimized image assets
  • README file to help you get started
  • HTML file with pre-written content

💡Ideas to test yourself

  1. Expand each color into a 50 to 950 tint and shade scale
  2. Fix failing contrast with one click
  3. Add an app dashboard to the preview
  4. Pull a palette from an uploaded photo
  5. Generate a DESIGN.md from the palette for a coding agent to follow
  6. Let users sign up and save their favorite palettes

Challenge FAQs

  • How can I get help if I'm stuck on a challenge?

    The best (and quickest) way to get help on a challenge is in our Discord server. There are thousands of other developers in there, so it's a great place to ask questions. We even have a dedicated "help" channel! If you haven't joined yet, you can get an invite to our Discord server here.

  • How do I submit my solution?

    We'd recommend reading our complete guide to submitting solutions. If you get stuck and need help, please feel free to ask questions in our Discord server, and we'll help you submit your project.

  • Is there an official solution I can take a look at?

    We don't provide "official" solutions for the challenges. This is because there is no single perfect way to complete a challenge. Instead, you're encouraged to review other people's code in the community. You can learn so much by seeing how other people have approached the same challenges and giving them feedback.

  • Do I get a code review when I post my solution?

    Yes. You get an AI code review on one solution a month, or on every solution with Pro, and other solutions still get our automated code checks. The community can review your code too, so ask a specific question when you submit.

  • Can I use libraries/frameworks on these projects?

    Yes! Our challenges provide professional designs but there are no rules on what tools to use. So feel free to use anything you like to build your projects.

  • Should I use AI tools when working on challenges?

    Yes, once you've got the basics. We'd suggest hand-coding the early levels first, because you need to read code to check what an agent writes. Then you can build alongside an AI agent, or direct one. Whichever way you build, test each feature yourself before you submit, including with a keyboard and on a small screen.

  • Can I use these projects in my portfolio?

    Definitely! Please do feel free to use whatever you build in your portfolio. Helping developers add professional-looking projects to their portfolio was one of the reasons we created this platform!

  • How often are new challenges added?

    We aim to launch a new challenge every two weeks, with a mix of free and premium challenges.

  • What is the difference between the desktop-design, mobile-design, and desktop-preview images in my starter code?

    The desktop-design and mobile-design images show you how the layout should look at large and small screen sizes. The desktop design is 1440px wide, and the mobile design is 375px. However, try building projects to look good on all screen sizes. The desktop-preview image is a preview image used in the README file. You don’t need to reference this while building the project.

  • Can I use these challenges within my own free or commercial content/tutorials/projects?

    Please visit our License page to learn more about how our challenges can be used within your own content. If you're unsure about anything, please feel free to contact us at [email protected] and we'll be more than happy to answer your questions.

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord