ngx-hun-party-colors
Version:
[](https://badge.fury.io/js/ngx-hun-party-colors) [](https://travis-ci.com/madar94/ngx-hun-party-colors)
45 lines (33 loc) • 1.3 kB
Markdown
# ngx-hun-party-colors
[](https://badge.fury.io/js/ngx-hun-party-colors)
[](https://travis-ci.com/madar94/ngx-hun-party-colors)
## Installation
```shell
npm install ngx-hun-party-colors --save
```
Once installed you need to import our main module in your application module:
```js
import { HUNPartyColorsModule } from 'ngx-hun-party-colors';
export class AppModule {
}
```
## Usage
```typescript
import { HUNPartyColorsService } from 'ngx-hun-party-colors';
export class YourComponent {
constructor(private colorService: HUNPartyColorsService) {}
getColors() {
this.colorService.getPartyColorHex('fidesz'); // Returns: #fd8100
this.colorService.getPartyColorRgb('Fidesz – Magyar Polgári Szövetség'); // Returns: rgb(253, 129, 0)
this.colorService.getPartyColorHsl('DK'); // Returns: hsl(210.11764705882354, 1, 0.5)
}
}
```
## Contributing
If you found a bug or want to propose a feature, feel free to visit [the issues page](https://github.com/madar94/ngx-hun-party-colors/issues).