2.0.0 • Published 6 years ago

imagination-react-native v2.0.0

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

imagination made with React Native

This is a new way of programming art.

What is imagination?

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.

What is it good for?

Nothing and everything! It's basically just a visual response to movement or orientation.

How to use the package

Simply install the package with

npm install imagination-react-native --save

Imagination itself

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()
}

ImaginationWrapper component

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>
  )
}

Credits

Imagination is an idea by Mathias Eriksson created for Matzielab

2.0.0

6 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago