This is a new way of programming art.
Imagination for devices takes your accelerometer and turns it into a color. It was created by Matzie for Matzielab as an experimental way of interaction response.
Nothing and everything! It's basically just a visual response to movement or orientation.
Simply install the package with
npm install imagination-react-native --save
You can retrieve the color by passing a function that'll recieve a rgb string whenever the acceleromter updates. It's also good to stop the accelerometer listener when unmounting or so.
import {Imagination} from 'imagination-react-native'
componentDidMount() {
Imagination.onColorChange( (color) => this.setState({color}) )
}
componentWillUnmount() {
Imagination.stop()
}
You can also use the ImaginationWrapper component. It automatically takes care of color changes and stopping. The background color of the component is updated to whatever color the accelerometer represents
import {ImaginationWrapper} from 'imagination-react-native'
render ():* {
return(
<ImaginationWrapper>
<Text>Such colors, amaze, wow</Text>
</ImaginationWrapper>
)
}
Imagination is an idea by Mathias Eriksson created for Matzielab