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 6175313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:54:13+00:00 2026-05-23T23:54:13+00:00

I want to have a gradient with rainbow colors. I have numeric values, the

  • 0

I want to have a gradient with rainbow colors.

I have numeric values, the maximum value is the color Red, and minimum value is the color Blue.
I try to find an algorithm to have proportional colors, i.e the half will be Green, between half and max will be Yellow or Orange….

I begin with this : Get color value from numeric values
But my function is not correct, if someone can help me… I try with HSV, RGB … But I am more WebDesigner than Developper..
Thanks !

EDIT —————–

This help ! Thanks a lot, I was sure that Value must be variable, but only with the Hue I get the right thing…

$h = ($value * 360) / $max;

$color = HSV_TO_RGB($h / 360, 1, 1);

First time, I forgot to divide by 360 to have a value between 0-1… I am an idiot. The HSV_TO_RGB function can be easily found on Web (hsv to rgb php in Google).
I get the right colors now, using a boucle.

Thanks a lot.

  • 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-05-23T23:54:13+00:00Added an answer on May 23, 2026 at 11:54 pm

    Basicaly what you will need is a HSV to RGB function with fixed Value and Saturation (let’s say 100 for saturation and value) and only change the Hue between 0 (your min value) and 360 (your max value).
    You can find many hsv2rgb php implementation over the network and i think that should do the trick.

    hope this help

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

Sidebar

Related Questions

I want to have a transparent background-color and I use gradient filter as a
I have set a custom gradient color background for my nav bar. I want
I have a gradient that changes its colors, I want the text inside it
I want my Spinner to have a black gradient background with white text on
I Want to have a gradient as the background of my webpage. I have
I have a UIView which I want to have a radial gradient, and I'm
I have an UIView and I want to change it's background color. That works
i want to have the gradient as background image like this how can i
I want to have a 1024px width website with a gradient background image. I
I have an UIView which I want to give a gradient background and I'm

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.