home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format 61
/
af061a.adf
/
Macros
/
ColourSeq3P.clssa
< prev
next >
Wrap
Text File
|
1993-07-15
|
3KB
|
105 lines
/***********************************************************************
GADGET: "'3 Colour Sequence'" "6" AUTO TYP: "?"
$DAT >><< 01 May 1993 - (C) ProDAD Holger Burkarth
This macro calculates a colour sequence in an animation. The
user selects a range as usual then a colour sequence is
calculated from the start to the end frame. In addition to this
the macro works with a sub-value which is calculated from the
current position. In this way a colour sequence can be created
with a transition colour.
***********************************************************************/
Options Results
Address clariSSA
FailAt 10
AltFail=RESULT
GetArea
PARSE VAR RESULT . "FROM" From "TO" To .
Number=To-From
IF Number>3 THEN DO
DO FOREVER
GetAnimInfo
PARSE VAR RESULT . "FORMAT" x y t "VIEWMODE" ViewMode . "POS" CurPos .
ColNumber=2**t - 1
MSRequester "TITLE '*** 3 Point Colour Sequence ***''Colour Sequence From "From" over "CurPos" To "To" ''Please select an Effect Mode.'",
"PTEXT 'All Colours ...''Colour Range ...'"
IF RC~=0 THEN LEAVE
Art=RESULT
IF Art=1 THEN DO
List=""
l=0
DO UNTIL l>ColNumber
List=List|| l " "
l=l+1
END
END
ELSE IF Art=2 THEN DO
COLRequest "FROM 0 TO 0 TITLE '*** 3 Point Colour Sequence ***'' ''Please select a colour range''for processing.'"
IF RC~=0 THEN LEAVE
List=RESULT
END
ViewFrame COPS CurPos
IF RC~=0 THEN LEAVE
GetColor List
Parting=RESULT
ViewFrame COPS To
IF RC~=0 THEN LEAVE
GetColor List
Last=RESULT
ViewFrame COPS From
IF RC~=0 THEN LEAVE
GetColor List
Start=RESULT
Number1=CurPos-From
Number2=To-CurPos+1
DO UNTIL From>To
ViewFrame COPS From
IF RC~=0 THEN LEAVE
IF From < CurPos THEN DO
MStart=Start
MLast=Parting
fa=(1-(CurPos-From)/Number1)
END; ELSE DO
MStart=Parting
MLast=Last
fa=((From-CurPos)/Number2)
END
l=0
List=""
DO UNTIL MStart=""
PARSE VAR MStart x Sr Sg Sb MStart
PARSE VAR MLast x Er Eg Eb MLast
r=Sr+(Er-Sr)*fa
g=Sg+(Eg-Sg)*fa
b=Sb+(Eb-Sb)*fa
List=List x TRUNC(r) TRUNC(g) TRUNC(b)
l=l+1
END
SetColor List
Record COPS
IF RC~=0 THEN LEAVE
From=From+1
END
LEAVE
END
END
ELSE Message "'For a Colour Sequence at least''4 Frames must be selected.'"
FailAt AltFail
exit