home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
sourcecode
/
subroutines
/
rgbproc2.amos
/
rgbproc2.amosSourceCode
Wrap
AMOS Source Code
|
1990-10-24
|
1KB
|
42 lines
' A Simple Colour selector which appears on current screen after saving its
' background . Waits for user to select a colour and returns the colours
' number as a param.
'
' By Gary Fearn 31/8/90
'
Flash Off : Curs Off
' INPUTS: X,Y coordinates and the size of the selector
RGBWINDOW[120,20,12]
_COL=Param
Print " You have selected colour ";
Pen _COL
Print _COL
Wait Key
Edit
'
Procedure RGBWINDOW[X,Y,SIZE]
'** This Proc returns the selcted colour as a param number **
'
NCOLS=Screen Colour
Get Cblock 1,X-10,Y-10,X+(SIZE*2)+10,Y+(SIZE*NCOLS/2)+10
Bar X-8,Y-8 To X+(SIZE*2)+8,Y+(SIZE*NCOLS/2)+8
Reserve Zone NCOLS+1
For B=0 To NCOLS/2 Step NCOLS/2
For A=0 To(NCOLS/2)-1
Ink A+B : Bar X,Y To X+SIZE,Y+SIZE
Set Zone A+B+1,X,Y To X+SIZE,Y+SIZE
Add Y,SIZE
Next A
Add X,SIZE
Add Y,-(SIZE*(NCOLS/2))
Next B
AGAIN:
While M=0
X=Mouse Zone
M=Mouse Key
Wend
If X=0 Then Goto AGAIN
Put Cblock 1
Reset Zone
RGB=X-1 : Rem RGB = selected colour
End Proc[RGB]