Skip to content

Commit 0791f98

Browse files
committed
refactor: Refactor color generation and gradient access
- Adjust loop iteration to generate random colors - Update indices to access different elements in the gradients array
1 parent 42125f0 commit 0791f98

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/gen/generate.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ pub fn get_all_colors(scheme: &mut Scheme) -> Vec<pastel::Color> {
199199
colors.push(col15.clone());
200200

201201
// Adding randomly generated colors to the mix
202-
for _ in 0..15 {
202+
for _ in 0..12 {
203203
let rng: &mut dyn RngCore = &mut thread_rng();
204204
let hue = rng.gen::<f64>() * 360.0;
205205
let saturation = 0.2 + 0.6 * rng.gen::<f64>();
@@ -213,32 +213,32 @@ pub fn get_all_colors(scheme: &mut Scheme) -> Vec<pastel::Color> {
213213
12,
214214
));
215215
}
216-
let lightish = gradients[3].clone();
217-
let darkish = gradients[22].clone();
216+
let lightish = gradients[2].clone();
217+
let darkish = gradients[21].clone();
218218

219219
colors.extend(gen_shades(
220220
vec![
221221
&lightish,
222222
&pastel::Color::from_rgb(255, 0, 0),
223223
&darkish,
224224
],
225-
12,
225+
24,
226226
));
227227
colors.extend(gen_shades(
228228
vec![
229229
&lightish,
230230
&pastel::Color::from_rgb(0, 255, 0),
231231
&darkish,
232232
],
233-
12,
233+
24,
234234
));
235235
colors.extend(gen_shades(
236236
vec![
237237
&lightish,
238238
&pastel::Color::from_rgb(0, 0, 255),
239239
&darkish,
240240
],
241-
12,
241+
24,
242242
));
243243

244244

0 commit comments

Comments
 (0)