ngx-hun-party-colors
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

ngx-hun-party-colors

npm version Build Status

Installation

npm install ngx-hun-party-colors --save

Once installed you need to import our main module in your application module:

import { HUNPartyColorsModule } from 'ngx-hun-party-colors';

@NgModule({
  declarations: [AppComponent, ...],
  imports: [HUNPartyColorsModule, ...],
  bootstrap: [AppComponent]
})
export class AppModule {
}

Usage

import { HUNPartyColorsService } from 'ngx-hun-party-colors';

@Component({...})
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.

Package Sidebar

Install

npm i ngx-hun-party-colors

Weekly Downloads

3

Version

0.0.3

License

MIT

Unpacked Size

84 kB

Total Files

30

Last publish

Collaborators

  • madar94