Skip to content

Commit

Permalink
chore: add additional signaturs for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 committed May 21, 2022
1 parent 83374fc commit 7d312b3
Showing 1 changed file with 119 additions and 0 deletions.
119 changes: 119 additions & 0 deletions src/modules/color/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,33 @@ export class Color {
format?: NumberColorFormat;
includeAlpha?: boolean;
}): number[];
/**
* Returns an RGB color.
*
* @param options Options object.
* @param options.prefix Prefix of the generated hex color. Only applied when 'hex' format is used. Defaults to `0x`.
* @param options.casing Letter type case of the generated hex color. Only applied when 'hex' format is used. Defaults to `mixed`.
* @param options.format Format of generated RGB color. Defaults to `hex`.
* @param options.includeAlpha Adds an alpha value to the color (RGBA). Defaults to `false`.
*
* @example
* faker.color.rgb() // '0xffffFF'
* faker.color.rgb({ prefix: '#' }) // '#ffffFF'
* faker.color.rgb({ casing: 'upper' }) // '0xFFFFFF'
* faker.color.rgb({ casing: 'lower' }) // '0xffffff'
* faker.color.rgb({ prefix: '#', casing: 'lower' }) // '#ffffff'
* faker.color.rgb({ format: 'hex', casing: 'lower' }) // '#ffffff'
* faker.color.rgb({ format: 'decimal' }) // [255, 255, 255]
* faker.color.rgb({ format: 'css' }) // 'rgb(255, 0, 0)'
* faker.color.rgb({ format: 'binary' }) // '10000000 00000000 11111111'
* faker.color.rgb({ format: 'decimal', includeAlpha: true }) // [255, 255, 255, 0.4]
*/
rgb(options?: {
prefix?: string;
casing?: Casing;
format?: 'hex' | ColorFormat;
includeAlpha?: boolean;
}): string | number[];
/**
* Returns an RGB color.
*
Expand Down Expand Up @@ -345,6 +372,19 @@ export class Color {
* faker.color.cmyk({ format: 'decimal' }) // [0.31, 0.52, 0.32, 0.43]
*/
cmyk(options?: { format?: NumberColorFormat }): number[];
/**
* Returns a CMYK color.
*
* @param options Options object.
* @param options.format Format of generated CMYK color. Defaults to 'decimal'.
*
* @example
* faker.color.cmyk() // [0.31, 0.52, 0.32, 0.43]
* faker.color.cmyk({ format: 'decimal' }) // [0.31, 0.52, 0.32, 0.43]
* faker.color.cmyk({ format: 'css' }) // cmyk(100%, 0%, 0%, 0%)
* faker.color.cmyk({ format: 'binary' }) // (8-32 bits) x 4
*/
cmyk(options?: { format?: ColorFormat }): string | number[];
/**
* Returns a CMYK color.
*
Expand Down Expand Up @@ -402,6 +442,26 @@ export class Color {
format?: NumberColorFormat;
includeAlpha?: boolean;
}): number[];
/**
* Returns an HSL color.
*
* @param options Options object.
* @param options.format Format of generated HSL color. Defaults to `decimal`.
* @param options.includeAlpha Adds an alpha value to the color (RGBA). Defaults to `false`.
*
* @example
* faker.color.hsl() // [201, 0.23, 0.32]
* faker.color.hsl({ format: 'decimal' }) // [300, 0.21, 0.52]
* faker.color.hsl({ format: 'decimal', includeAlpha: true }) // [300, 0.21, 0.52, 0.28]
* faker.color.hsl({ format: 'css' }) // hsl(0deg, 100%, 80%)
* faker.color.hsl({ format: 'css', includeAlpha: true }) // hsl(0deg 100% 50% / 0.5)
* faker.color.hsl({ format: 'binary' }) // (8-32 bits) x 3
* faker.color.hsl({ format: 'binary', includeAlpha: true }) // (8-32 bits) x 4
*/
hsl(options?: {
format?: ColorFormat;
includeAlpha?: boolean;
}): string | number[];
/**
* Returns an HSL color.
*
Expand Down Expand Up @@ -463,6 +523,19 @@ export class Color {
* faker.color.hwb({ format: 'decimal' }) // [201, 0.21, 0.31]
*/
hwb(options?: { format?: NumberColorFormat }): number[];
/**
* Returns an HWB color.
*
* @param options Options object.
* @param options.format Format of generated RGB color. Defaults to `decimal`.
*
* @example
* faker.color.hwb() // [201, 0.21, 0.31]
* faker.color.hwb({ format: 'decimal' }) // [201, 0.21, 0.31]
* faker.color.hwb({ format: 'css' }) // hwb(194 0% 0%)
* faker.color.hwb({ format: 'binary' }) // (8-32 bits x 3)
*/
hwb(options?: { format?: ColorFormat }): string | number[];
/**
* Returns an HWB color.
*
Expand Down Expand Up @@ -513,6 +586,19 @@ export class Color {
* faker.color.lab({ format: 'decimal' }) // [0.856773, -80.2345, 100.2341]
*/
lab(options?: { format?: NumberColorFormat }): number[];
/**
* Returns a LAB (CIELAB) color.
*
* @param options Options object.
* @param options.format Format of generated RGB color. Defaults to `decimal`.
*
* @example
* faker.color.lab() // [0.832133, -80.3245, 100.1234]
* faker.color.lab({ format: 'decimal' }) // [0.856773, -80.2345, 100.2341]
* faker.color.lab({ format: 'css' }) // lab(29.2345% 39.3825 20.0664)
* faker.color.lab({ format: 'binary' }) // (8-32 bits x 3)
*/
lab(options?: { format?: ColorFormat }): string | number[];
/**
* Returns a LAB (CIELAB) color.
*
Expand Down Expand Up @@ -576,6 +662,22 @@ export class Color {
* faker.color.lch({ format: 'decimal' }) // [0.522345, 72.2, 56.2]
*/
lch(options?: { format?: NumberColorFormat }): number[];
/**
* Returns an LCH color. Even though upper bound of
* chroma in LCH color space is theoretically unbounded,
* it is bounded to 230 as anything above will not
* make a noticeable difference in the browser.
*
* @param options Options object.
* @param options.format Format of generated RGB color. Defaults to `decimal`.
*
* @example
* faker.color.lch() // [0.522345, 72.2, 56.2]
* faker.color.lch({ format: 'decimal' }) // [0.522345, 72.2, 56.2]
* faker.color.lch({ format: 'css' }) // lch(52.2345% 72.2 56.2)
* faker.color.lch({ format: 'binary' }) // (8-32 bits x 3)
*/
lch(options?: { format?: ColorFormat }): string | number[];
/**
* Returns an LCH color. Even though upper bound of
* chroma in LCH color space is theoretically unbounded,
Expand Down Expand Up @@ -641,6 +743,23 @@ export class Color {
format?: NumberColorFormat;
space?: CSSSpace;
}): number[];
/**
* Returns a random color based on CSS color space specified.
*
* @param options Options object.
* @param options.format Format of generated RGB color. Defaults to `decimal`.
* @param options.space Color space to generate the color for. Defaults to `sRGB`;
*
* @example
* faker.color.colorByCSSColorSpace() // [0.93, 1, 0.82]
* faker.color.colorByCSSColorSpace({ format: 'decimal' }) // [0.12, 0.21, 0.31]
* faker.color.colorByCSSColorSpace({ format: 'css', space: 'display-p3' }) // color(display-p3 0.12 1 0.23)
* faker.color.colorByCSSColorSpace({ format: 'binary' }) // (8-32 bits x 3)
*/
colorByCSSColorSpace(options?: {
format?: ColorFormat;
space?: CSSSpace;
}): string | number[];
/**
* Returns a random color based on CSS color space specified.
*
Expand Down

0 comments on commit 7d312b3

Please sign in to comment.