Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8120397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:09:11+00:00 2026-06-06T05:09:11+00:00

OK Stackoverflowians, Here’s the riddle for the day. I have a weather sidebar widget

  • 0

OK Stackoverflowians, Here’s the riddle for the day.

I have a weather sidebar widget on a WordPress site that snags all of its data from the Google Weather API. I would like to set a gradient from RED to BLUE and then, by the magic of the javascript gods, to look at the value of the temperature.

Higher number = closer to RED
Lower Number = closer to BLUE

Is there anything out there that can do this? Or would I have to start from scratch?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T05:09:12+00:00Added an answer on June 6, 2026 at 5:09 am

    You could express the color using two dimensions like this:

    var max_temp = 50, // set maximum expected temperature
    min_temp = -10, // set minimum temperature
    temp_range = max_temp - min_temp, // calculate range
    temp_rating = ((temp - min_temp) / temp_range) * 255 // express value in terms of the range multiplied by 255
    red = temp_rating, // more temp = more red
    blue = 255 - temp_rating; // more temp = less blue
    

    Then your CSS color would become:

    rgb(red, 0, blue)
    

    No idea if it will look nice though 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello Stackoverflowians, I have a questions in regards to what is the best way
I have a string that contains some values I need to extract. Each of
Greetings StackOverflowians, As discovered here , Windows 7 features a bug in which the
I have been googling and stackoverflowing for the last two hours and couldn't find
I receive some xml-files with embedded base64-encoded images, that I need to decode and
I'm trying to piece together all the examples I've seen for finding elements and
Merry Christmas, StackOverflowians! I started out distributing my .NET GAC-located program using Inno Setup,
What I'm trying to do is fairly simple. I have two classes: public class
Hello my fellow Stackoverflownians :), I just came across this thing called Zend. And
Before I say a word, let me thank the community for being the authoritative

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.