2.2.5 • Published 6 years ago

react-native-image-gradient v2.2.5

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

Image gradient, react component

React native package to display a gradient filter over an image.

To install

  • Run npm install react-native-image-gradient -s.
  • Run react-native link (or follow instructions to add react-native-linear-gradient to your project here).

Usage

import ImageGradient from 'react-native-image-gradient';

...

render(){
    return (
        <ImageGradient 
            mainStyle={styles.YOURS}
            gradientStyle={styles.YOURS}
            localImage={true|false}
            imageUrl={localReference|webReference}
            startPosition ={{x:0,y:0}}
            rgbcsvStart={'255,255,255'}
            rgbcsvEnd={'0,0,0'}
            opacityStart={0.9}
            opacityEnd={0.0}
        >
            <...>

        </ImageGradient>
    )
}

Props

  • mainStyle - styling for the main view component.
  • gradientStyle - styling for the iner view containing gradient view.
  • imageUrl - local or web path to the image. (if using web path, please set the localImage prop to false).
  • localImage - flag to specify wether the path is local or not. Default: true.
  • startPosition - initial coordinates for the gradient effect.Range 0-1.
  • endPosition - final coordinates for the gradient effect.Range 0-1.

    PS: X is from left to right and Y is from top to bottom. Check the image below.

  • rgbcsvStart - color (in csv format) for the beginning of the linear gradient. Default: black '255,255,255'.
  • rgbcsvEnd - color (in csv format) for the end of the linear gradient. Default: white '0,0,0'.
  • opacityStart - opacity for the primary color. Range 0-1.
  • opacityEnd - opacity for the secondary color. Range 0-1.

PS: All props are optional

image

2.2.5

6 years ago

2.2.4

6 years ago

2.2.3

6 years ago

2.2.2

6 years ago

2.2.1

6 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago