Hi Try using the KImageEffect::gradient() from kdeui with the DiagonalGradient or CrossDiagonalGradient effect types. If you apply it to carefully chosen rectangles then clip the resulted image to the object form you need, you obtain aleatorily rotated gradients. It's extremely fast too. Better to avoid use of the libm functions (which will slow things down a lot). libm is particularly famous for inefficacity on Linux. Cristian Tibirna On Mon, 20 Dec 1999, Tobias Burnus wrote: > Hi, > > I have a question concerning gradients. What is the best methode to create > linear gradients with arbitrary angles of the shading? I tried to create > something based on the Gradiant.cc code in killustrator (which supported only > linear gradients with the angles 0° and 90°). My code works somehow, but not > that well (especially bad are values closer to the tan 90° singularity that is > [45°-]89°). > > If somebody has a nice workable idea, please share it. > > Tobias > > PS: I put the changes into CVS, present limits: angles besides 0° are not saved, > old files with 90° (=vertical) are converted to 0°. I of cause plan to change > this, when I got the gradients working. > >