omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Fun...numbers and colours

    Pythonista
    1
    1
    760
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Phuket2
      Phuket2 last edited by

      I am sure this code has been done 1000 x 1000 times. But was sitting here thinking about when I can access the microphone (next release) , could change the ui to a blues mode, or heavy rock etc etc... Based on what song is playing. If done well, with a fade in and out could be nice. Ok, dreaming again.

      
      import ui, motion
      import sys
      
      main_view = None
      
      def motion_color(): 
      	if not main_view.on_screen : 
      		motion.stop_updates()
      		sys.exit(999)
      	color=  motion.get_attitude()
      	main_view.background_color = color
      	ui.delay(motion_color, .1)
      			
      if __name__ == '__main__':
      	v = ui.View()
      	main_view = v
      	motion.start_updates()
      	ui.delay(motion_color, .1)
      	v.present()
      	
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Powered by NodeBB Forums | Contributors