Facebook Pixel

Color Code Game

React.js
medium
30 mins

Create an interactive game where the user is shown a random HEX color code (e.g., #FF5733) and must guess the correct color from three colored boxes.

Requirements

  • Display a random HEX color code at the top.

  • Render 3 color boxes below it.

  • On clicking a box:

    • Show "Correct!" if the color matches.
    • Show "Incorrect!" otherwise.
    • Display a "Play Again" button to reset the game.

Required Elements and Attributes for Testing

  • HEX Color Code Display - Must contain a text element matching #[A-F0-9]{6} (e.g. #FF00FF)

  • Color Option Boxes - Each box must have:

    • role="button"
    • aria-label="Color option #XXXXXX" (e.g. Color option #FF00FF)
  • Feedback Text - Must display either:

    • "Correct!"
    • "Incorrect!"
  • Play Again Button - Must contain the visible text: "Play Again"

Reference UI

colorCodeGame

Preview what you need to build

Companies:

adobe
linkedin
reddit

Solve Similar questions 🔥

Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.