Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Opacity

Provides a way to create a set of divisions that have nice aliases to access them:

example
A basic set of divisions ```ts const opacity = new Opacity({ base: 0.6 }); opacity.transparent; opacity.translucent; opacity.semi; // -> 0.6; opacity.cloudy; opacity.opaque; ```
example
Customise scaling, reduces the range of the divisions ```ts const opacity = new Opacity({ base: 0.5, scale: (0.15 as Scale) }); ```
example
Customise certain stops (or all of them `100` to `900`) ```ts const opacity = new Opacity({ base: { 500: 0.6, 600: 0.65, 700: 0.8 }}); ```

Hierarchy

Implements

Index

Constructors

constructor

  • new Opacity(__namedParameters?: object): Opacity

Accessors

100

  • get 100(): number

200

  • get 200(): number

300

  • get 300(): number

400

  • get 400(): number

500

  • get 500(): number

600

  • get 600(): number

700

  • get 700(): number

800

  • get 800(): number

900

  • get 900(): number

cloudy

  • get cloudy(): number

opaque

  • get opaque(): number

semi

  • get semi(): number

translucent

  • get translucent(): number

transparent

  • get transparent(): number

Methods

__@toPrimitive

  • __@toPrimitive(hint: "string" | "number" | "default"): number | string