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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:12:39+00:00 2026-05-19T03:12:39+00:00

I am building a color picker that uses CSS gradients instead on images. I

  • 0

I am building a color picker that uses CSS gradients instead on images. I have a CSS gradient that works for HSB color selection but I am unable to create a CSS gradient for HSB color selection. You can see the original gradient at:
http://jsfiddle.net/qVsFN/

Gradient 1 should look like gradient 2. Is it possible to do this with only css? I tryed several things including radial gradients with no luck.

Here is the css and markup I am using:

#red_grad {
    background: -moz-linear-gradient(0deg, rgba(255, 255, 255, 1), rgba(255, 0, 0, 1)) repeat scroll 0 0 transparent;
    background: -webkit-gradient(linear, left center, right center, from(rgba(255, 255, 255, 1)), to(rgba(255, 0, 0, 1)));
    height: 262px;
    width: 262px;
}
#black_grad {
    background: -moz-linear-gradient(90deg, rgba(0, 0, 0, 1), transparent) repeat scroll 0 0 transparent;
    background: -webkit-gradient(linear, center bottom, center top, from(rgba(0, 0, 0, 1)), to(transparent)) repeat scroll 0 0 transparent;
    height: 262px;
    width: 262px;
}

<div id="red_grad">
    <div id="black_grad">
    </div>
</div>

You can see it live at http://jsfiddle.net/qVsFN/

  • 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-19T03:12:39+00:00Added an answer on May 19, 2026 at 3:12 am

    The HSL Saturation-Lightness plane can be made with 2 linear gradients:

    1. Lightness: White to transparent to black (the horizontal gradient)
    2. Saturation: Fully saturated color to gray (#808080) (the vertial gradient)

    Here’s a fiddle with it: http://jsfiddle.net/leaverou/qVsFN/3/

    Notes:

    • What you got wrong on the first one and confused you is that you thought you’re limited to only 2 color stops per gradient. As you can see, they’re more flexible than that 🙂
    • Why 4 color stops instead of 3 for the Lightness gradient? Because transparent is actually mapped to rgba(0,0,0,0) so a transparent to white gradient is not what you expect.
    • You don’t need 2 elements in CSS3, you can have multiple backgrounds in just one image, so I removed the extra element. 😉

    And what about changing the hue? Just substitute red for the fully saturated version of the new color (Hue = whatever, sat = 100, lightness = 50) — and there’s your color picker!

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

Sidebar

Related Questions

i building a drawing app that uses openGl. i am new to openGL but
I'm building a Wordpress theme, and I have these snippets in my style.css: #content
I have some JSON that looks like: groups: [ group_id: 8, group_name: Building, group_color:
I am building a custom color picker in WPF and want to save/read the
I'm building a Web Page that allows the user to pick a color and
I'm currently building a WordPress theme that I would like to have a header
I am building a blog and for my comments I have this CSS. #comments
I am building a web application where I have set my default color to
Building an inventory system. I have lots of products and each product has three
building a site using PHP and MySQL that needs to store a lot of

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.