hi,
this is the code for a small colour picker
rem +++++++++++++ colourpicker (of sorts) ++++++++++++++++++++++++++++
set window on
set window size 640,480
sync on
long = 255 :rem maximum colour value
l#=7.9687: rem scale value of 'long'
for t = 1 to long*4
rem red up
if t<long then r=255
rem red down
if t>long and r>0 then r=long*2-t
rem green up
if t>long/2 and g<long then g=t-long/2
rem green down
if t>long*2 and g>0 then g=long*3-t
rem blue up
if t>long*2 and b<long then b=t-long*2
rem blue down
if t>long*3 then b=long*4-t:g=0:r = t-long*4
rem draw
ink rgb(r,g,b),0
line t/l#,0,t/l#,32
rem
next t
rem get image
get image 1,0,0,128,32
cls 0
rem dummy object
make object sphere 1,1:hide object 1
set text size 16
do
rem paste image to screen
paste image 1,1,1
ink 0,0
text 2,40,"drag mouse along bar"
text 2,55," to choose colour"
rem read 't'
for t = 1 to long*4
rem red up
if t<long then r=255
rem red down
if t>long and r>0 then r=long*2-t
rem green up
if t>long/2 and g<long then g=t-long/2
rem green down
if t>long*2 and g>0 then g=long*3-t
rem blue up
if t>long*2 and b<long then b=t-long*2
rem blue down
if t>long*3 then b=long*4-t:g=0:r = t-long*4
rem condition for read
if t/8 = mousex() then ink rgb(r,g,b),0
next t
rem draw value box
box 20,90,70,120
ink 0,0
text 24,130,"result"
sync
loop
could someone please tell me how to get the result rgb numbers
nicely shown on screen ......
and also, how I can alter the gamma, just in the result box and not on the whole screen ... and include the gamma in the rgb numbers ?
kind regards,
miki.
(the maths idiot)
in the end