SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Sep 2004
    Location
    India
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    controlling the brightness using slider

    Hi,

    Is it possible to control the brightness of a gradient using a slider.
    i.e. if I use a gradient for my page, can i increase or decrease the brightness?
    The same can be done if its a solid color, But for the gradient I have no clue. Any help ll be greatly appreciated.

    Thanks,
    kedar

  2. #2
    SitePoint Wizard
    Join Date
    Dec 2003
    Location
    USA
    Posts
    2,582
    Mentioned
    29 Post(s)
    Tagged
    0 Thread(s)
    It depends how you implement the gradient. If you implemented it as an image, you could tweak the opacity of the gradient (if it had a white background underneath the gradient) which would give the appearance of changing the brightness.

    If you implement it in some code-based way, it should be of little trouble to change the brightness of the codes that make it up and recreate the gradient.

    Hope that helps.

  3. #3
    Function Curry'er JimmyP's Avatar
    Join Date
    Aug 2007
    Location
    Brighton, UK
    Posts
    2,006
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by samanime View Post
    It depends how you implement the gradient. If you implemented it as an image, you could tweak the opacity of the gradient (if it had a white background underneath the gradient) which would give the appearance of changing the brightness.
    Alternatively you could append (using JS) a white element on top of the gradient and adjust the opacity... - either way is fine.
    James Padolsey
    末末末末末末末末末末末末末末末末末末末
    Awesome JavaScript Zoomer (demo here)
    'Ajaxy' - Ajax integration solution (demo here)

  4. #4
    SitePoint Member
    Join Date
    Sep 2004
    Location
    India
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys for the prompt reply, I would be grateful if someome can show me how to achieve that as I am a novice in the JS coding.
    Please ,Its a request, please,

    Thanks a ton,
    kedar

  5. #5
    SitePoint Wizard
    Join Date
    Dec 2003
    Location
    USA
    Posts
    2,582
    Mentioned
    29 Post(s)
    Tagged
    0 Thread(s)
    To be perfectly honest, I don't know how to do this off of the top of my head, I'd have to look it up.

    This looks like a good starting place: http://www.atalasoft.com/cs/blogs/da...h-opacity.aspx

    If you have any questions, we can help.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •