0.1.2 • Published 6 years ago

sp-auto-color v0.1.2

Weekly downloads
13
License
MIT
Repository
github
Last release
6 years ago

sp-auto-color

auto-color is a wrapper component that manages the text color on the basis of background color.

selects white font color for dark backgrounds and black for light on the basis of threshold.

default threshold value is 128

it supports hex, rgb & rgba coloring formats

Installation & Usage

install the package

$ npm i --save sp-auto-color
import AutoColor from 'sp-auto-color';

...


render () {
    return (
        ...

            <AutoColor threshold={128} backgroundColor={'rgb(223, 252, 178)'}>
                ...your code here
            </AutoColor>

        ...
    )
}
0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.1

6 years ago