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

[REBOL] Re: Colors in a gradient effect

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