Greyscale bars/Display: Difference between revisions

m
Line 638:
[[File:GrayscalesR.png|thumb|right]]
<lang futurebasic>
 
_window = 1
 
 
void local fn BuildGrayBarWindow
NSInteger i
NSUInteger i
float gray
 
CGRect r = fn CGRectMake( 0, 0, 640, 400 )
window _window, @"Gray Scale Window", r
WindowSetBackgroundColor( _window, fn ColorBlack )
 
gray = 0.0
r = fn CGrectMake( 0, 300, 80, 100 )
for i = 1 to 8
textfield i, YES,,r,_window
TextFieldSetEditable( i, NO )
TextFieldSetBackgroundColor( i, fn ColorWithRGB( gray, gray, gray, 1.0 ) )
r = fn CGRectOffset( r, 80, 0 )
gray += 0.125142857142857143 // 1/7
next
 
gray = 1.0
r = fn CGrectMake( 0, 200, 40, 100 )
for i = 10 to 26
textfield i, YES,,r,_window
TextFieldSetEditable( i, NO )
TextFieldSetBackgroundColor( i, fn ColorWithRGB( gray, gray, gray, 1.0 ) )
r = fn CGRectOffset( r, 40, 0 )
gray -= 0.0625066666666666667 // 1/5
next
 
gray = 0.0
r = fn CGrectMake( 0, 100, 20, 100 )
for i = 30 to 62
textfield i, YES,,r,_window
TextFieldSetEditable( i, NO )
TextFieldSetBackgroundColor( i, fn ColorWithRGB( gray, gray, gray, 1.0 ) )
r = fn CGRectOffset( r, 20, 0 )
gray += 0.03125032258064516129 // 1/31
next
 
gray = 1.0
r = fn CGrectMake( 0, 0, 10, 100 )
for i = 100 to 164
textfield i, YES,,r,_window
TextFieldSetEditable( i, NO )
TextFieldSetBackgroundColor( i, fn ColorWithRGB( gray, gray, gray, 1.0 ) )
r = fn CGRectOffset( r, 10, 0 )
gray -= 0.015625015873015873016 // 1/63
next
end fn
 
723

edits