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

  • Home
  • SEARCH
  • 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 7861215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:37:10+00:00 2026-06-02T22:37:10+00:00

I have a float score, which is 0 to 1 I need translate this

  • 0

I have a float score, which is 0 to 1

I need translate this score to color,

0 is green

1 is red

0.5 should at the middle of green to red gradient color

and so on

how to write this? I have no idea.

  • 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-02T22:37:12+00:00Added an answer on June 2, 2026 at 10:37 pm

    let gradient colour parameter be t, 0.0 =< t =< 1.0

    colour = RGB(255 * t, 255 * (1 - t), 0)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two float values, 'a' and 'b' . I need to calculate the
If I have this float array declaration: float tables[10]; How can I change the
I have this situation: { float foo[10]; for (int i = 0; i <
I need to store pairs of float,int in which the int value stores the
I have a typedef boost::variant<int, float, double, long, bool, std::string, boost::posix_time::ptime> variant which I
I have six arrays which are of float type. Any specific index in all
I've seen a few questions which float around this topic but nothing which quite
I have a map<Float,Object>. I need it store valuse like 0.01 ->ObjA 0.02 ->ObjB
I suddenly just thought of this and got stuck deciding which data type should
I have a (float) rating value as a percentage from 0..100 (where 50 =

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.