Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 30

Thread: Color Blending?

  1. #1
    New Coder
    Join Date
    Jun 2004
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Color Blending?

    Hi everyone I was wondering if anyone knows a way to blend 1 color into another?

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Using Javascript? Or using like a couple of cans of paint?

    Sorry, I really don't know! This is probably not the right place for this thread.. hopefully a Moderator will move it the appropriate place.

    Good luck,
    Sadiq.

  • #3
    New Coder
    Join Date
    Jun 2004
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool

    I want to do it using Javascript if at all possible

  • #4
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You're going to have to give a lot more information than that. What are you trying to do anyway?

    Oh, are you trying to say change the colour of a table cell, or background colour or font colour or something?

    Well that's done using hexadecimal numbering. Check out this site:
    http://www.w3schools.com/html/html_colors.asp

    Basically you RRGGBB where RR is the amount of red, GG is the amount of green, and BB is the amount of BB. 00 is none, FF is full, and any hexadecimal number in between is the amount of that colour that you want.

    That way, you're 'blending' between the colour red, green, and blue.

    Hope that makes sense. Good luck,
    Sadiq.

  • #5
    New Coder
    Join Date
    Jun 2004
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post

    No what I mean is that the color starts of at lets say magenta and it ends in lets say red so the magenta changes into red as it get further along
    And I mean on a vertical or horizontal bar so you get something like:
    ====================================================
    But I want to apply it to a div or a span and hav it as the background color(s)
    So am I in the right forum? If I am can someone please help me?
    Thanks to anyone and everyone that helps
    Last edited by M1k3-+i3; 06-30-2004 at 09:12 PM.

  • #6
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    As a background colour?? I don't know for sure, but I don't think this is possible. You'd have to create an image that had this 'fading' look and put that as the background image of the div.

    Other than that, I don't think it's possible.

    Something you might be able to do is create a table with a thousand columns each 1px wide and fill the table cells with the appropriate values of hexadecimal start at magenta and finishing at red.

    You could probably write a Javascript routine to do that, but I'm not sure how you'd get that as a background colour still..

    Perhaps someone else on the board has some thoughts on this.

    Sadiq.

  • #7
    New Coder
    Join Date
    Jun 2004
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post

    I know for a fact its possible I have seen it but I just cant remember where.

    And creating a 1000 table cells all 1px each would result in very long load times and also I might want to put some text over the blending background.

    And a picture would be pointless because once I have done it with Magenta to Red then I'm obvioiusly gonna try different combos which would result in tons of pictures.

    But thanks for your help

  • #8
    New Coder
    Join Date
    Jun 2004
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    If this can't be done in javascript what can it be done in?

  • #9
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I know that the table option would take a long time and you wouldn't be able type over it (unless you used layers.. but I don't know anything about layers, just remember seeing the term someplace).

    As for the picture option, you might be able to do it with PHP. PHP allows you to create images, and it might be possible to pass certain parameters, such as height, width, starting colour, and finishing colour, and have the PHP routine create the picture you want based on that.

    Unfortunately, that's all the help I can provide. Check out this link (and Google) for more information on the PHP option:
    http://builder.com.com/5100-6371-5092227.html

    Good luck,
    Sadiq.

  • #10
    Regular Coder
    Join Date
    Jun 2002
    Posts
    338
    Thanks
    0
    Thanked 0 Times in 0 Posts
    http://msdn.microsoft.com/workshop/a...s/gradient.asp
    Note: IE-only.

    Hope that helps!

    Happy coding!

  • #11
    New Coder
    Join Date
    Aug 2002
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Microsoft has some proprietary functions within CSS that will do blending/shading. Try the css forum.

  • #12
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You could use a for or while loop to add 1 to the hexidecimal value. I had a script which did that but can not find it ATM. Try searching the forum because I'm sure I posted it at one time....

    .......Willy

  • #13
    New Coder
    Join Date
    Jun 2004
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile I have found it

    I have found what I was looking for l'll post it in my webspace so you can see it. Its IE only I think don't know what versions either but it'll do.

    l'll post the address soon

  • #14
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just comment if you want to make that effect constant with those 2 colors doing anything else than using a picture is a waste of load time and cpu time.

  • #15
    New Coder
    Join Date
    Jun 2004
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Your

    wrong
    Quote Originally Posted by Garadon
    doing anything else than using a picture is a waste of load time and cpu time.
    Because what I have found is relatively short an loads within seconds.
    Last edited by M1k3-+i3; 07-01-2004 at 06:12 PM.


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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