Lab: Random Color API with $.ajax()

Lab: Random Color API with $.ajax()

Use the CSS Colors API to fetch a random color and use the color and it’s details to update the UI of the provided application

1) Get the starter code

  • The starter code for this lab is hosted on Github, see the url below:

  • Use the Assignment Submission Git Workflow (detailed here) to access and submit the assignment

2) Test the API endpoint using Insomnia

Here’s the API endpoint that you will use:

GET https://css-colors-api.herokuapp.com/api/v1/colors/random

3) Using $.ajax() to make an API request to the CSS Colors API

  • Use jQuery to fill the Circle’s background color with the hex code retrieved from the API call

  • Fill in the Color name and hexcode in the details area under the circle with information received from the API call