Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fusoionic/ng-tailwind-color

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fusoionic/ng-tailwind-color

Angular helper functions/pipe for coloring (build on top of TinyColor2)

  • 1.3.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Angular Tailwind Color Helpers/Pipes

Angular helper functions/pipe for coloring (build on top of TinyColor2)

NPM Version Package License NPM Downloads Package Size

Installation

npm i @fusoionic/ng-tailwind-color

Usage


Module:

Import TailwindModule from @fusoionic/ng-tailwind-color

import { TailwindModule } from '@fusoionic/ng-tailwind-color';

@NgModule({
  imports: [
    TailwindModule.forRoot({ ... }), // inject services
    TailwindModule, // inject pipes
  ]
})

Resolve color

Resolve color with pipe

<!-- Tailwind string -->
<span [style.color]="'red-500' | twHex"></span>

<!-- Tailwind string with alpha/opacity -->
<span [style.color]="'red-500/50' | twRgb"></span> <!-- 50 = 0.5 -->
import {TailwindService} from '@fusoionic/ng-tailwind-color';

export class AppComponent implements OnInit {
  constructor(
    private twService: TailwindService,
  ){}

  ngOnInit(){
    this.twService.resolve('red-500').darken(50).toHex();
  }
}

Available Pipes


twHex - Resolves color to HEX
twRgb - Resolves color to RGBA
twHsl - Resolves color to HSL
twHsv - Resolves color to HSV

twInvertHex - Inverts color and returns it as HEX
twInvertRgb - Inverts color and returns it as RGBA
twInvertHsl - Inverts color and returns it as HSL
twInvertHsv - Inverts color and returns it as HSV

twLightenHex - Lightens color by given amount and returns it as HEX
twLightenRgb - Lightens color by given amount and returns it as RGBA
twLightenHsl - Lightens color by given amount and returns it as HSL
twLightenHsv - Lightens color by given amount and returns it as HSV

twDarkenHex - Darkens color by given amount and returns it as HEX
twDarkenRgb - Darkens color by given amount and returns it as RGBA
twDarkenHsl - Darkens color by given amount and returns it as HSL
twDarkenHsv - Darkens color by given amount and returns it as HSV

Keywords

FAQs

Package last updated on 01 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc