Results 1 to 4 of 4

Math Help - how to draw a gradient square?

  1. #1
    Newbie
    Joined
    May 2008
    Posts
    2

    how to draw a gradient square?

    Hi all
    i need to draw a square and i need to fill it with radial color gradient. For that i have the ratios and corresponding colors.Is there any algorithms to do gradient fillng?

    i dont know wether this question is related to this forum of not!
    If any body have some idea on this issue,please guide me.

    thanks
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Super Member
    earboth's Avatar
    Joined
    Jan 2006
    From
    Germany
    Posts
    5,830
    Thanks
    123
    Quote Originally Posted by lakshmikanth View Post
    Hi all
    i need to draw a square and i need to fill it with radial color gradient. For that i have the ratios and corresponding colors.Is there any algorithms to do gradient fillng?

    i dont know wether this question is related to this forum of not!
    If any body have some idea on this issue,please guide me.

    thanks
    I'm just curious: What do you mean by "gradient filling"?

    - Does that imply that the colour depends on the distance from the center of the square? (see attachment)

    - Does that mean the colour depends on the slope of the line passing through the center of the square?

    - Does that mean that I've misunderstood you completely?
    Attached Thumbnails Attached Thumbnails how to draw a gradient square?-colorgradient.jpg  
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    May 2008
    Posts
    2
    thanx for ur reply.

    what i mean for 'gradient filling' is to creat a gradient with the given colors and ratios.

    i want to create a radial gradient squrare (just like in the attachment you sent) and want to apply transformations on it.for that i have some colors(rgba) and ratios(values between 0-255).
    But for radial gradient i dont know how to use these colors and ratios.is there any algorithm for create a radial gradient?


    I am new to this subject and please guide me on this issue.
    thank you.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Super Member
    earboth's Avatar
    Joined
    Jan 2006
    From
    Germany
    Posts
    5,830
    Thanks
    123
    Quote Originally Posted by lakshmikanth View Post
    thanx for ur reply.

    what i mean for 'gradient filling' is to creat a gradient with the given colors and ratios.

    i want to create a radial gradient squrare (just like in the attachment you sent) and want to apply transformations on it.for that i have some colors(rgba) and ratios(values between 0-255).
    But for radial gradient i dont know how to use these colors and ratios.is there any algorithm for create a radial gradient?


    I am new to this subject and please guide me on this issue.
    thank you.
    I assume that you know how colours are stored in one number.

    This number can be used to define pen.color, brush.color or font.color (I program a little bit in Delphi and these are the commands to change the properties of pen, brush or font)

    You can determine a straight line between 2 points [moveto(x1,y1); lineto(x2,y2)] and you can calculate the distance between 2 points.
    According to the distance you can change the colour number:
    \$ \underbrace{00}_{palette}\underbrace{1A}_{blue} \underbrace{BC}_{green}\underbrace{13}_{red}

    ... but I still don't understand how this square should look like which you want to create with your computer
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. how to draw sin(1/x)
    Posted in the Trigonometry Forum
    Replies: 7
    Last Post: November 28th 2010, 05:08 AM
  2. draw
    Posted in the Algebra Forum
    Replies: 6
    Last Post: November 23rd 2010, 09:30 AM
  3. Replies: 3
    Last Post: February 21st 2010, 09:39 AM
  4. how to draw it?
    Posted in the Calculus Forum
    Replies: 5
    Last Post: February 9th 2010, 10:04 AM
  5. A Draw
    Posted in the Statistics Forum
    Replies: 1
    Last Post: November 29th 2009, 02:05 PM

Search Tags


/mathhelpforum @mathhelpforum