Skip to content

Commit

Permalink
Fix typos (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanBaulch authored Jan 9, 2025
1 parent a472fc2 commit 9e385f7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ alpha colors, this means the RGB values are lost (set to 0) and it's impossible
to recover them. In such a case `MakeColor` will return `false` as its second value.

### Comparing colors
In the RGB color space, the Euclidian distance between colors *doesn't* correspond
In the RGB color space, the Euclidean distance between colors *doesn't* correspond
to visual/perceptual distance. This means that two pairs of colors which have the
same distance in RGB space can look much further apart. This is fixed by the
CIE-L\*a\*b\*, CIE-L\*u\*v\* and CIE-L\*C\*h° color spaces.
Expand Down Expand Up @@ -201,7 +201,7 @@ What you see is that HSV is really bad: it adds some green, which is not present
in the original colors at all! RGB is much better, but it stays light a little
too long. LUV and LAB both hit the right lightness but LAB has a little more
color. HCL works in the same vein as HSV (both cylindrical interpolations) but
it does it right in that there is no green appearing and the lighthness changes
it does it right in that there is no green appearing and the lightness changes
in a linear manner.

While this seems all good, you need to know one thing: When interpolating in any
Expand Down Expand Up @@ -309,11 +309,11 @@ generating this picture in `doc/colorgens/colorgens.go`.

### Getting random palettes
As soon as you need to generate more than one random color, you probably want
them to be distinguishible. Playing against an opponent which has almost the
them to be distinguishable. Playing against an opponent which has almost the
same blue as I do is not fun. This is where random palettes can help.

These palettes are generated using an algorithm which ensures that all colors
on the palette are as distinguishible as possible. Again, there is a `Fast`
on the palette are as distinguishable as possible. Again, there is a `Fast`
method which works in HSV and is less perceptually uniform and a non-`Fast`
method which works in CIE spaces. For more theory on `SoftPalette`, check out
[I want hue](http://tools.medialab.sciences-po.fr/iwanthue/theory.php). Yet
Expand Down
2 changes: 1 addition & 1 deletion hsluv.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (col Color) HPLuv() (h, s, l float64) {
return LuvLChToHPLuv(col.LuvLChWhiteRef(hSLuvD65))
}

// DistanceHSLuv calculates Euclidan distance in the HSLuv colorspace. No idea
// DistanceHSLuv calculates Euclidean distance in the HSLuv colorspace. No idea
// how useful this is.
//
// The Hue value is divided by 100 before the calculation, so that H, S, and L
Expand Down
4 changes: 2 additions & 2 deletions soft_palettegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func SoftPaletteExWithRand(colorsCount int, settings SoftPaletteSettings, rand R

// The actual k-means/medoid iterations
for i := 0; i < settings.Iterations; i++ {
// Reassing the samples to clusters, i.e. to their closest mean.
// Reassigning the samples to clusters, i.e. to their closest mean.
// By the way, also check if any sample is used as a medoid and if so, mark that.
for isample, sample := range samples {
samples_used[isample] = false
Expand All @@ -99,7 +99,7 @@ func SoftPaletteExWithRand(colorsCount int, settings SoftPaletteSettings, rand R

// Compute new means according to the samples.
for imean := range means {
// The new mean is the average of all samples belonging to it..
// The new mean is the average of all samples belonging to it.
nsamples := 0
newmean := lab_t{0.0, 0.0, 0.0}
for isample, sample := range samples {
Expand Down

0 comments on commit 9e385f7

Please sign in to comment.