font-color-pipe
Advanced tools
Comparing version 0.0.0 to 0.0.1
{ | ||
"name": "font-color-pipe", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"license": "MIT", | ||
"homepage": "https://johnfedoruk.github.io/font-color-pipe/index.html", | ||
"scripts": { | ||
"ng": "ng", | ||
"start": "ng serve", | ||
"build": "ng build --prod", | ||
"test": "ng test", | ||
"lint": "ng lint", | ||
"e2e": "ng e2e", | ||
"packagr": "ng-packagr -p ng-package.json -p ng-package.json", | ||
"landing": "npm run build-landing && npm run deploy-landing", | ||
"build-landing": "ng build --prod --aot --base-href https://johnfedoruk.github.io/font-color-pipe/", | ||
"deploy-landing": "node node_modules/angular-cli-ghpages/bin/angular-cli-ghpages --no-silent" | ||
}, | ||
"private": false, | ||
"dependencies": { | ||
"tslib": "^1.7.1" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
@@ -26,2 +37,3 @@ "@angular-devkit/core": "^0.4.8", | ||
"@types/node": "~6.0.60", | ||
"angular-cli-ghpages": "^0.5.2", | ||
"codelyzer": "^4.0.1", | ||
@@ -44,8 +56,3 @@ "core-js": "^2.4.1", | ||
"zone.js": "^0.8.14" | ||
}, | ||
"main": "bundles/font-color-pipe.umd.js", | ||
"module": "esm5/font-color-pipe.js", | ||
"es2015": "esm2015/font-color-pipe.js", | ||
"typings": "font-color-pipe.d.ts", | ||
"metadata": "font-color-pipe.metadata.json" | ||
} | ||
} |
# FontColorPipe | ||
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.6.3. | ||
This project contains an [Angular](https://angular.io) pipe that can be used for calculating the best font to display over an arbitrary background. The pipe, FontColorPipe, is exported from the FontColorModule. | ||
## Development server | ||
## [Demo](https://johnfedoruk.github.io/font-color-pipe/index.html) | ||
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. | ||
## NPM | ||
## Code scaffolding | ||
```bash | ||
npm install --save font-color-pipe | ||
``` | ||
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. | ||
## Usage | ||
## Build | ||
```TypeScript | ||
import { BrowserModule } from '@angular/platform-browser'; | ||
import { NgModule } from '@angular/core'; | ||
import { FontColorModule } from 'font-color-pipe'; | ||
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build. | ||
import { AppComponent } from './app.component'; | ||
## Running unit tests | ||
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). | ||
@NgModule({ | ||
declarations: [ | ||
AppComponent | ||
], | ||
imports: [ | ||
BrowserModule, | ||
FontColorModule | ||
], | ||
providers: [], | ||
bootstrap: [AppComponent] | ||
}) | ||
export class AppModule { } | ||
``` | ||
## Running end-to-end tests | ||
> ./src/app/app/module.ts | ||
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). | ||
```TypeScript | ||
import { Component, OnInit, ElementRef } from '@angular/core'; | ||
## Further help | ||
const WHITE: string = "#FFFFFF"; | ||
const BLACK: string = "#000000"; | ||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). | ||
@Component({ | ||
selector: 'app-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.css'] | ||
}) | ||
export class AppComponent implements OnInit { | ||
public _bg: string = WHITE; | ||
constructor(private ref:ElementRef) {} | ||
public ngOnInit(): void { | ||
setInterval( | ||
() => | ||
this.bg = this.bg === BLACK ? WHITE : BLACK, | ||
1000 | ||
); | ||
} | ||
public set bg(bg: string) { | ||
this._bg = bg; | ||
this.ref.nativeElement.style.backgroundColor = this.bg; | ||
} | ||
public get bg(): string { | ||
return this._bg; | ||
} | ||
} | ||
``` | ||
> src/app/app.component.ts | ||
```html | ||
<h1 id="font" [ngStyle]="{'color':bg | fontColor}">Hello</h1> | ||
``` | ||
> src/app/app.component.html | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
32183
0
34
614
1
78
34
1
2
- Removedtslib@^1.7.1
- Removedtslib@1.14.1(transitive)