Skip to content

Commit 39b7aad

Browse files
committed
Fix some typos and add cylindrical averaging diagram
1 parent 4b7a6fc commit 39b7aad

3 files changed

Lines changed: 16 additions & 10 deletions

File tree

docs/src/markdown/average.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,23 @@ and averaging each channel independently. Additionally, by default, transparency
66
premultiplication which weights the colors such that more opaque colors have a greater significance in the mixing vs
77
more translucent colors.
88

9-
![Average RGB](images/avg-rgb.png)
10-
11-
129
Averaging under ColorAide can take as many colors as desired and will return a color that represents the average. This
13-
is not to be confused with interpolation which employs a different technique. One thing that sets it apart from
14-
interpolation is that when performing the operation, the order of the colors does not matter and will yield the same
15-
results even the colors are shuffled.
10+
approach to mixing is not to be confused with interpolation which employs a different technique. One thing that sets it
11+
apart from interpolation is that when performing the operation, the order of the colors does not matter and will yield
12+
the same results even if the colors are shuffled.
1613

1714
Averaging can be used as a way to mix multiple colors into one color or simply determine what the overall average color
1815
is from a set of colors. Results are subject to the geometry of the color space in which the average is performed.
1916

2017
## Rectangular Space Averaging
2118

22-
ColorAide, by default, averages in the rectangular Linear sRGB color spaces. If desired, other color spaces can be used.
23-
Results will vary due to the geometry of the color space being used.
19+
ColorAide, by default, averages colors in the rectangular Linear sRGB color spaces. For most, averaging in rectangular
20+
spaces would most likely be the common approach.
21+
22+
![Average RGB](images/avg-rgb.png)
23+
24+
While linear sRGB is the default color space when averaging, other color spaces can be used. Results will vary due to
25+
the geometry of the color space being used.
2426

2527
```py play
2628
Color.average(['red', 'blue'])
@@ -37,10 +39,14 @@ Color.average(['red', 'yellow', 'orange', 'green'])
3739
## Cylindrical Space Averaging
3840

3941
ColorAide can also average colors in cylindrical spaces. When applying averaging in a cylindrical space, hues will be
40-
averaged taking the circular mean. Due the difference in approach, colors can be quite different.
42+
averaged taking the circular mean. Due the difference in approach, color averaging in a cylindrical space can be quite
43+
different.
44+
45+
![Average HSL](images/avg-hsl.png)
46+
47+
To perform averaging in a cylindrical/polar space, simply specify the space when averaging.
4148

4249
```py play
43-
Color.average(['purple', 'green', 'blue'])
4450
Color.average(['purple', 'green', 'blue'], space='hsl')
4551
```
4652

143 KB
Loading
2.98 KB
Loading

0 commit comments

Comments
 (0)