Skip to content

Commit

Permalink
Fix scaling on random distribution of Lab/Lch
Browse files Browse the repository at this point in the history
  • Loading branch information
okaneco committed May 16, 2020
1 parent b4f0dcd commit acf85d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion palette/src/lab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ where
// `a` and `b` both range from (-128.0, 127.0)
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Lab<Wp, T> {
Lab {
l: rng.gen(),
l: rng.gen() * from_f64(100.0),
a: rng.gen() * from_f64(255.0) - from_f64(128.0),
b: rng.gen() * from_f64(255.0) - from_f64(128.0),
white_point: PhantomData,
Expand Down
2 changes: 1 addition & 1 deletion palette/src/lch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ where
{
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Lch<Wp, T> {
Lch {
l: rng.gen(),
l: rng.gen() * from_f64(100.0),
chroma: crate::Float::sqrt(rng.gen()) * from_f64(128.0),
hue: rng.gen::<LabHue<T>>(),
white_point: PhantomData,
Expand Down

0 comments on commit acf85d1

Please sign in to comment.