aboutsummaryrefslogtreecommitdiff
path: root/src/modules/color
diff options
context:
space:
mode:
authorEric Cheng <[email protected]>2022-08-28 09:59:51 -0400
committerGitHub <[email protected]>2022-08-28 15:59:51 +0200
commit379ba79ba3b9735ed039d87f32fc14fa9920d4ed (patch)
treee2ab2bf145231bafc6aaa73ccfdd0124ee3e3c03 /src/modules/color
parentf78843edb05913c44ebd86535b0d50d22e99fc5e (diff)
downloadfaker-379ba79ba3b9735ed039d87f32fc14fa9920d4ed.tar.xz
faker-379ba79ba3b9735ed039d87f32fc14fa9920d4ed.zip
fix(datatype): unintentional hex breaking change (#1306)
Co-authored-by: Leyla Jähnig <[email protected]>
Diffstat (limited to 'src/modules/color')
-rw-r--r--src/modules/color/index.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/modules/color/index.ts b/src/modules/color/index.ts
index d64b7750..faa898d4 100644
--- a/src/modules/color/index.ts
+++ b/src/modules/color/index.ts
@@ -297,7 +297,10 @@ export class Color {
let color: string | number[];
let cssFunction: CSSFunction = 'rgb';
if (format === 'hex') {
- color = this.faker.datatype.hexadecimal({ length: includeAlpha ? 8 : 6 });
+ color = this.faker.datatype.hexadecimal({
+ length: includeAlpha ? 8 : 6,
+ prefix: '',
+ });
color = formatHexColor(color, options);
return color;
}