ngx-hun-party-colors
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.