aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShinigami <[email protected]>2023-03-23 14:01:26 +0100
committerGitHub <[email protected]>2023-03-23 13:01:26 +0000
commit5f3df23a22ca50d495c6a0beaf3a94849db1f12a (patch)
tree2ff5815715958dde3595a9cc6601c9493c204f25 /src
parent26d8ac0501ec61f7520265994ed45f8c7cf3ca2a (diff)
downloadfaker-5f3df23a22ca50d495c6a0beaf3a94849db1f12a.tar.xz
faker-5f3df23a22ca50d495c6a0beaf3a94849db1f12a.zip
docs(color): fix color rgb docs (#1958)
Diffstat (limited to 'src')
-rw-r--r--src/modules/color/index.ts60
1 files changed, 30 insertions, 30 deletions
diff --git a/src/modules/color/index.ts b/src/modules/color/index.ts
index 4d69ebf5..b18fae65 100644
--- a/src/modules/color/index.ts
+++ b/src/modules/color/index.ts
@@ -231,7 +231,7 @@ export class ColorModule {
* Returns an RGB color.
*
* @example
- * faker.color.rgb() // '0xffffFF'
+ * faker.color.rgb() // '#8be4ab'
*
* @since 7.0.0
*/
@@ -240,20 +240,20 @@ export class ColorModule {
* 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.prefix Prefix of the generated hex color. Only applied when 'hex' format is used. Defaults to `'#'`.
+ * @param options.casing Letter type case of the generated hex color. Only applied when `'hex'` format is used. Defaults to `'lower'`.
* @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: 'css' }) // 'rgb(255, 0, 0)'
- * faker.color.rgb({ format: 'binary' }) // '10000000 00000000 11111111'
+ * faker.color.rgb() // '#8be4ab'
+ * faker.color.rgb({ prefix: '0x' }) // '0x9ddc8b'
+ * faker.color.rgb({ casing: 'upper' }) // '#B8A51E'
+ * faker.color.rgb({ casing: 'lower' }) // '#b12f8b'
+ * faker.color.rgb({ prefix: '#', casing: 'lower' }) // '#eb0c16'
+ * faker.color.rgb({ format: 'hex', casing: 'lower' }) // '#bb9d17'
+ * faker.color.rgb({ format: 'css' }) // 'rgb(216, 17, 192)'
+ * faker.color.rgb({ format: 'binary' }) // '00110010 00001000 01110110'
*
* @since 7.0.0
*/
@@ -261,13 +261,13 @@ export class ColorModule {
/**
* Prefix of the generated hex color. Only applied when 'hex' format is used.
*
- * @default '0x'
+ * @default '#'
*/
prefix?: string;
/**
* Letter type case of the generated hex color. Only applied when `'hex'` format is used.
*
- * @default 'mixed'
+ * @default 'lower'
*/
casing?: Casing;
/**
@@ -291,9 +291,9 @@ export class ColorModule {
* @param options.includeAlpha Adds an alpha value to the color (RGBA). Defaults to `false`.
*
* @example
- * faker.color.rgb() // '0xffffFF'
- * faker.color.rgb({ format: 'decimal' }) // [255, 255, 255]
- * faker.color.rgb({ format: 'decimal', includeAlpha: true }) // [255, 255, 255, 0.4]
+ * faker.color.rgb() // '0x8be4ab'
+ * faker.color.rgb({ format: 'decimal' }) // [64, 192,174]
+ * faker.color.rgb({ format: 'decimal', includeAlpha: true }) // [52, 250, 209, 0.21]
*
* @since 7.0.0
*/
@@ -315,22 +315,22 @@ export class ColorModule {
* 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.prefix Prefix of the generated hex color. Only applied when `'hex'` format is used. Defaults to `'#'`.
+ * @param options.casing Letter type case of the generated hex color. Only applied when `'hex'` format is used. Defaults to `'lower'`.
* @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]
+ * faker.color.rgb() // '#0d7f26'
+ * faker.color.rgb({ prefix: '0x' }) // '0x9ddc8b'
+ * faker.color.rgb({ casing: 'upper' }) // '#B8A51E'
+ * faker.color.rgb({ casing: 'lower' }) // '#b12f8b'
+ * faker.color.rgb({ prefix: '#', casing: 'lower' }) // '#eb0c16'
+ * faker.color.rgb({ format: 'hex', casing: 'lower' }) // '#bb9d17'
+ * faker.color.rgb({ format: 'decimal' }) // [64, 192,174]
+ * faker.color.rgb({ format: 'css' }) // 'rgb(216, 17, 192)'
+ * faker.color.rgb({ format: 'binary' }) // '00110010 00001000 01110110'
+ * faker.color.rgb({ format: 'decimal', includeAlpha: true }) // [52, 250, 209, 0.21]
*
* @since 7.0.0
*/
@@ -338,13 +338,13 @@ export class ColorModule {
/**
* Prefix of the generated hex color. Only applied when `'hex'` format is used.
*
- * @default '0x'
+ * @default '#'
*/
prefix?: string;
/**
* Letter type case of the generated hex color. Only applied when `'hex'` format is used.
*
- * @default 'mixed'
+ * @default 'lower'
*/
casing?: Casing;
/**