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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:09:14+00:00 2026-05-22T16:09:14+00:00

I know there has already been posts on this, but I still don’t quite

  • 0

I know there has already been posts on this, but I still don’t quite get it.. I want to have a script that automatically generates a color code ({color:Lighter}) which would be a lighter version of {color:Links}. I would want the script to take the colorcode of {color:Links} use the hex code, (it has to be hex) and make it like 10 times lighter. Very close to white, but off white enough so that you can still see the color. Can someone please provide me with a code?

  • 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-22T16:09:14+00:00Added an answer on May 22, 2026 at 4:09 pm

    What you are doing is blend between two colors, so you calculate the color components like this:

    c = c0 + (c1-c0) * x

    where c0 and c1 are the two colors, and x is the balance between them. You would use a value close to 1 to to get a color close to the second one. I don’t know exactly what you mean by “ten times lighter”, but you could try a value like 0.9, which would give you a blend where the white stands for 90% of the result.

    As white is rgb(255,255,255), you calculate the RGB values as:

    r = r0 + (255-r0) * 0.9
    g = g0 + (255-g0) * 0.9
    b = b0 + (255-b0) * 0.9
    

    Then you just use them in CSS as 'rgb('+r+','+g+','+b+')'.

    If you need it as a hex code, you can format it like this:

    '#'+(256+r).toString(16).substr(1)+(256+g).toString(16).substr(1)+(b+256).toString(16).substr(1)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know there has been a lot of posts on this but it still
I have a feeling this has already been answered, but I don't know the
I know this has been discussed a lot of times but is there any
So I know there have been a couple of posts around about this topic,
I am sorry if this has been asked already, but I have been looking
I know this question has already been asked, but the solution doesn't work in
I know that UIAppearance has been introduced in iOS 5, but is there any
I know this has probably already been answered somewhere, I just can't find it.
I'm sure this has already been done, but Google isn't helping me - I'm
I know this has been addressed many times, but i just cant seem to

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.