Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Colors in a gradient effect

 [1/6] from: philb::upnaway::com at: 13-Jul-2001 18:49


Has anyone got any ideas why when a gradient effect is applied the colors in the gradient aren't evenly distributed? For example checking the green colors created by view layout [size 100x100 backdrop effect [gradient 0x1 0.100.0 0.200.0]] Screen printing and viewing in PSP I see that the first few colors are pixel 01 - 04 : 0.103.0 pixel 05 - 08 : 0.104.0 pixel 09 - 12 : 0.111.0 pixel 13 - 16 : 0.112.0 pixel 17 - 20 : 0.119.0 pixel 21 - 24 : 0.120.0 this gives the gradient a sort of "stripey" look. Seems strange to me .... Cheers Phil

 [2/6] from: arolls:bigpond:au at: 14-Jul-2001 1:21


They seem evenly distributed to me. I checked in PaintShopPro. What screen mode are you running? What platform are you running on?

 [3/6] from: max:ordigraphe at: 13-Jul-2001 11:45


Hi, I usually get this effect if I'm missing colors for the spread if the gradient is done in angle (corner to corner) I have noticed that the effect almost becomes like a printing dither pattern. If I expand the color palette, the patterns, disappear. -Max << Don't rush me Sonny - you rush a miracle man, you get lousy miracles
>>
Miracle Max (Princess Bride) ------------- Maxim Olivier-Adlhoch

 [4/6] from: arolls:bigpond:au at: 14-Jul-2001 4:26


Ok, I see the problem effect now. Here is a program I wrote so the rest of you can see it quickly. You should set it to diagonal, then resize window to very wide but not very high: rebol [ Title: "Colour Spread" File: %colour-spread.r Date: 14-Jul-2001 Version: 1.0.0 Needs: [view] Author: "Anton Rolls" Language: 'English Purpose: {Show colour gradients in a resizeable window} ToDo: { - some way to make image thinner than window's minimum width } History: [ 1.0.0 [14-Jul-2001 { First version Inspired by rebol-list discussion "Colours in a gradient" today } "Anton"] ] Notes: {} ] first-colour: green / 2 last-colour: blue / 2 refresh: does [ pic/size: lay/size - pic/offset pic/effect: compose [fit gradient (pick [0x1 1x0 1x1] index? dr/data) (first-colour) (last-colour)] show pic ] view/new/options center-face lay: layout [ origin 0 space 0 across label "colors:" right button "first" 60 [first-colour: request-color refresh] button "last" 60 [last-colour: request-color refresh] dr: rotary data ["down" "across" "diagonal"] [refresh] return pic: image do [ resize-event-func: insert-event-func [ if event/type = 'resize [refresh] return event ] ] ] 'resize refresh wait none remove-event-func :resize-event-func halt

 [5/6] from: allenk:powerup:au at: 14-Jul-2001 10:04


Phil, On my system they are only stripy if viewing in anything lower than True Color 24bit mode Cheers, Allen K

 [6/6] from: philb:upnaway at: 14-Jul-2001 11:35


Hi Anton, My original problem was caysed by my Win98 desktop being in 16bit (High Colour) mode. When I changed to 32bit (True colour it my gradient look fine) Didnt think that there should be so much difference between 16bit & 32 bit. In fact in 16 bit all my Windows title bars change color from dark blue to light blue nicely. However your program does seem to show the same sort of stripes happening even in 32bit true color so I think there "might" a problem with the was Rebol is assigning the colors. Cheers Phil -- Original Mail -- Ok, I see the problem effect now. Here is a program I wrote so the rest of you can see it quickly. You should set it to diagonal, then resize window to very wide but not very high: rebol [ Title: "Colour Spread" File: %colour-spread.r Date: 14-Jul-2001 Version: 1.0.0 Needs: [view] Author: "Anton Rolls" Language: 'English Purpose: {Show colour gradients in a resizeable window} ToDo: { - some way to make image thinner than window's minimum width } History: [ 1.0.0 [14-Jul-2001 { First version Inspired by rebol-list discussion "Colours in a gradient" today } "Anton"] ] Notes: {} ] first-colour: green / 2 last-colour: blue / 2 refresh: does [ pic/size: lay/size - pic/offset pic/effect: compose [fit gradient (pick [0x1 1x0 1x1] index? dr/data) (first-colour) (last-colour)] show pic ] view/new/options center-face lay: layout [ origin 0 space 0 across label "colors:" right button "first" 60 [first-colour: request-color refresh] button "last" 60 [last-colour: request-color refresh] dr: rotary data ["down" "across" "diagonal"] [refresh] return pic: image do [ resize-event-func: insert-event-func [ if event/type = 'resize [refresh] return event ] ] ] 'resize refresh wait none remove-event-func :resize-event-func halt