Skip to content

Commit 5f3df23

Browse files
authored
docs(color): fix color rgb docs (#1958)
1 parent 26d8ac0 commit 5f3df23

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

src/modules/color/index.ts

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ export class ColorModule {
231231
* Returns an RGB color.
232232
*
233233
* @example
234-
* faker.color.rgb() // '0xffffFF'
234+
* faker.color.rgb() // '#8be4ab'
235235
*
236236
* @since 7.0.0
237237
*/
@@ -240,34 +240,34 @@ export class ColorModule {
240240
* Returns an RGB color.
241241
*
242242
* @param options Options object.
243-
* @param options.prefix Prefix of the generated hex color. Only applied when 'hex' format is used. Defaults to `'0x'`.
244-
* @param options.casing Letter type case of the generated hex color. Only applied when `'hex'` format is used. Defaults to `'mixed'`.
243+
* @param options.prefix Prefix of the generated hex color. Only applied when 'hex' format is used. Defaults to `'#'`.
244+
* @param options.casing Letter type case of the generated hex color. Only applied when `'hex'` format is used. Defaults to `'lower'`.
245245
* @param options.format Format of generated RGB color. Defaults to `hex`.
246246
* @param options.includeAlpha Adds an alpha value to the color (RGBA). Defaults to `false`.
247247
*
248248
* @example
249-
* faker.color.rgb() // '0xffffFF'
250-
* faker.color.rgb({ prefix: '#' }) // '#ffffFF'
251-
* faker.color.rgb({ casing: 'upper' }) // '0xFFFFFF'
252-
* faker.color.rgb({ casing: 'lower' }) // '0xffffff'
253-
* faker.color.rgb({ prefix: '#', casing: 'lower' }) // '#ffffff'
254-
* faker.color.rgb({ format: 'hex', casing: 'lower' }) // '#ffffff'
255-
* faker.color.rgb({ format: 'css' }) // 'rgb(255, 0, 0)'
256-
* faker.color.rgb({ format: 'binary' }) // '10000000 00000000 11111111'
249+
* faker.color.rgb() // '#8be4ab'
250+
* faker.color.rgb({ prefix: '0x' }) // '0x9ddc8b'
251+
* faker.color.rgb({ casing: 'upper' }) // '#B8A51E'
252+
* faker.color.rgb({ casing: 'lower' }) // '#b12f8b'
253+
* faker.color.rgb({ prefix: '#', casing: 'lower' }) // '#eb0c16'
254+
* faker.color.rgb({ format: 'hex', casing: 'lower' }) // '#bb9d17'
255+
* faker.color.rgb({ format: 'css' }) // 'rgb(216, 17, 192)'
256+
* faker.color.rgb({ format: 'binary' }) // '00110010 00001000 01110110'
257257
*
258258
* @since 7.0.0
259259
*/
260260
rgb(options?: {
261261
/**
262262
* Prefix of the generated hex color. Only applied when 'hex' format is used.
263263
*
264-
* @default '0x'
264+
* @default '#'
265265
*/
266266
prefix?: string;
267267
/**
268268
* Letter type case of the generated hex color. Only applied when `'hex'` format is used.
269269
*
270-
* @default 'mixed'
270+
* @default 'lower'
271271
*/
272272
casing?: Casing;
273273
/**
@@ -291,9 +291,9 @@ export class ColorModule {
291291
* @param options.includeAlpha Adds an alpha value to the color (RGBA). Defaults to `false`.
292292
*
293293
* @example
294-
* faker.color.rgb() // '0xffffFF'
295-
* faker.color.rgb({ format: 'decimal' }) // [255, 255, 255]
296-
* faker.color.rgb({ format: 'decimal', includeAlpha: true }) // [255, 255, 255, 0.4]
294+
* faker.color.rgb() // '0x8be4ab'
295+
* faker.color.rgb({ format: 'decimal' }) // [64, 192,174]
296+
* faker.color.rgb({ format: 'decimal', includeAlpha: true }) // [52, 250, 209, 0.21]
297297
*
298298
* @since 7.0.0
299299
*/
@@ -315,36 +315,36 @@ export class ColorModule {
315315
* Returns an RGB color.
316316
*
317317
* @param options Options object.
318-
* @param options.prefix Prefix of the generated hex color. Only applied when `'hex'` format is used. Defaults to `'0x'`.
319-
* @param options.casing Letter type case of the generated hex color. Only applied when `'hex'` format is used. Defaults to `'mixed'`.
318+
* @param options.prefix Prefix of the generated hex color. Only applied when `'hex'` format is used. Defaults to `'#'`.
319+
* @param options.casing Letter type case of the generated hex color. Only applied when `'hex'` format is used. Defaults to `'lower'`.
320320
* @param options.format Format of generated RGB color. Defaults to `'hex'`.
321321
* @param options.includeAlpha Adds an alpha value to the color (RGBA). Defaults to `false`.
322322
*
323323
* @example
324-
* faker.color.rgb() // '0xffffFF'
325-
* faker.color.rgb({ prefix: '#' }) // '#ffffFF'
326-
* faker.color.rgb({ casing: 'upper' }) // '0xFFFFFF'
327-
* faker.color.rgb({ casing: 'lower' }) // '0xffffff'
328-
* faker.color.rgb({ prefix: '#', casing: 'lower' }) // '#ffffff'
329-
* faker.color.rgb({ format: 'hex', casing: 'lower' }) // '#ffffff'
330-
* faker.color.rgb({ format: 'decimal' }) // [255, 255, 255]
331-
* faker.color.rgb({ format: 'css' }) // 'rgb(255, 0, 0)'
332-
* faker.color.rgb({ format: 'binary' }) // '10000000 00000000 11111111'
333-
* faker.color.rgb({ format: 'decimal', includeAlpha: true }) // [255, 255, 255, 0.4]
324+
* faker.color.rgb() // '#0d7f26'
325+
* faker.color.rgb({ prefix: '0x' }) // '0x9ddc8b'
326+
* faker.color.rgb({ casing: 'upper' }) // '#B8A51E'
327+
* faker.color.rgb({ casing: 'lower' }) // '#b12f8b'
328+
* faker.color.rgb({ prefix: '#', casing: 'lower' }) // '#eb0c16'
329+
* faker.color.rgb({ format: 'hex', casing: 'lower' }) // '#bb9d17'
330+
* faker.color.rgb({ format: 'decimal' }) // [64, 192,174]
331+
* faker.color.rgb({ format: 'css' }) // 'rgb(216, 17, 192)'
332+
* faker.color.rgb({ format: 'binary' }) // '00110010 00001000 01110110'
333+
* faker.color.rgb({ format: 'decimal', includeAlpha: true }) // [52, 250, 209, 0.21]
334334
*
335335
* @since 7.0.0
336336
*/
337337
rgb(options?: {
338338
/**
339339
* Prefix of the generated hex color. Only applied when `'hex'` format is used.
340340
*
341-
* @default '0x'
341+
* @default '#'
342342
*/
343343
prefix?: string;
344344
/**
345345
* Letter type case of the generated hex color. Only applied when `'hex'` format is used.
346346
*
347-
* @default 'mixed'
347+
* @default 'lower'
348348
*/
349349
casing?: Casing;
350350
/**

0 commit comments

Comments
 (0)