Skip to content

Commit acf85d1

Browse files
committed
Fix scaling on random distribution of Lab/Lch
1 parent b4f0dcd commit acf85d1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

palette/src/lab.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ where
701701
// `a` and `b` both range from (-128.0, 127.0)
702702
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Lab<Wp, T> {
703703
Lab {
704-
l: rng.gen(),
704+
l: rng.gen() * from_f64(100.0),
705705
a: rng.gen() * from_f64(255.0) - from_f64(128.0),
706706
b: rng.gen() * from_f64(255.0) - from_f64(128.0),
707707
white_point: PhantomData,

palette/src/lch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ where
589589
{
590590
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Lch<Wp, T> {
591591
Lch {
592-
l: rng.gen(),
592+
l: rng.gen() * from_f64(100.0),
593593
chroma: crate::Float::sqrt(rng.gen()) * from_f64(128.0),
594594
hue: rng.gen::<LabHue<T>>(),
595595
white_point: PhantomData,

0 commit comments

Comments
 (0)