https://github.com/nilllzz/colorize-filter
JS Module to apply a hex color to an image through css filters
https://github.com/nilllzz/colorize-filter
css css-filter javascript js npm ts typescript
Last synced: 8 months ago
JSON representation
JS Module to apply a hex color to an image through css filters
- Host: GitHub
- URL: https://github.com/nilllzz/colorize-filter
- Owner: nilllzz
- License: mit
- Created: 2019-10-08T10:20:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-08-02T03:52:09.000Z (almost 5 years ago)
- Last Synced: 2025-02-14T08:49:26.661Z (over 1 year ago)
- Topics: css, css-filter, javascript, js, npm, ts, typescript
- Language: TypeScript
- Size: 13.7 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# colorize-filter
JS Module to apply a hex color to an image through css filters
# Installation
```sh
npm install colorize-filter --save
yarn add colorize-filter
```
# Usage
### Javascript
```javascript
var colorizeFilter = require("colorize-filter");
var filter = colorizeFilter.generateFilter("dead00");
console.log(filter);
```
Output should be `invert(75%) sepia(89%) saturate(3406%) hue-rotate(13deg) brightness(101%) contrast(104%)`.
### Typescript
```typescript
import { generateFilter } from "colorize-filter";
const filter = generateFilter("dead00");
console.log(filter);
```
Output should be `invert(75%) sepia(89%) saturate(3406%) hue-rotate(13deg) brightness(101%) contrast(104%)`.