Skip to content

Commit a112313

Browse files
committed
Fix examples and returns on random-color snippets
1 parent e123867 commit a112313

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

snippets/javascript/color-manipulation/random-hex-color.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ function getRandomHexColor() {
1111
}
1212

1313
// Usage:
14-
getRandomHexColor(); // Returns: "#RRGGBB" (random)
14+
getRandomHexColor(); // Returns: "#f904d7" (random)
1515
```

snippets/javascript/color-manipulation/random-hsl-color.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ function getRandomHslColor() {
1010
const h = Math.floor(Math.random() * 360);
1111
const s = Math.floor(Math.random() * 101);
1212
const l = Math.floor(Math.random() * 101);
13-
return [h, s, l];
13+
return { h, s, l };
1414
}
1515

1616
// Usage:
17-
getRandomHslColor(); // Returns: (h, s, l) (random)
17+
getRandomHslColor(); // Returns: { h: 357, s: 53, l: 49 } (random)
1818
```

snippets/javascript/color-manipulation/random-rgb-color.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ function getRandomRgbColor() {
1010
const r = Math.floor(Math.random() * 256);
1111
const g = Math.floor(Math.random() * 256);
1212
const b = Math.floor(Math.random() * 256);
13-
return (r, g, b);
13+
return { r, g, b };
1414
}
1515

1616
// Usage:
17-
getRandomRgbColor(); // Returns: (r, g, b) (random)
17+
getRandomRgbColor(); // Returns: { r: 189, g: 120, b: 201 } (random)
1818
```

0 commit comments

Comments
 (0)