@@ -105,8 +105,9 @@ def ShowNeoPixels(*pixels):
105105advance_button .enableFeedback ("fl" )
106106
107107# create a graphical layer (LayerGraphical) to show the color set using the following sliders
108- color_layer = LayerGraphical (dd , 150 , 101 )
108+ color_layer = LayerGraphical (dd , 255 , 255 )
109109color_layer .border (5 , "black" , "round" , 2 )
110+ color_layer .enableFeedback ("fs:rpt50" )
110111
111112# create R slider (LayerJoystick) for controlling R (0-255)
112113r_slider_layer = LayerJoystick (dd , 255 , "hori" , 0.5 )
@@ -189,6 +190,16 @@ def ShowNeoPixels(*pixels):
189190 if fb :
190191 # if there is "feedback" from the B slider, its x position will be the new value for b
191192 b = fb .x
193+ fb : Feedback = color_layer .getFeedback ()
194+ if fb :
195+ r = fb .x
196+ g = fb .y
192197 if r != old_r or g != old_g or b != old_b :
193198 # set the background color of the color layer to the new (r, g, b) color
194199 color_layer .backgroundColor (RGB_COLOR (r , g , b ))
200+ if r != old_r :
201+ r_slider_layer .moveToPos (r , 0 )
202+ if g != old_g :
203+ g_slider_layer .moveToPos (g , 0 )
204+ if b != old_b :
205+ b_slider_layer .moveToPos (b , 0 )
0 commit comments