Skip to content

Commit

Permalink
Fix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
adrhill committed Aug 7, 2023
1 parent ec63b36 commit 1f9ba36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[deps]
ColorQuantization = "652893fb-f6a0-4a00-a44a-7fb8fac69e01"
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
DitherPunk = "b8f752a5-abd5-43b6-a55b-e75efda20de0"
Expand Down
5 changes: 3 additions & 2 deletions docs/literate/color_cycling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
# We will try to fake a subtle animation of the water in this public domain image:
using Images
using DitherPunk
using ColorQuantization
using IndirectArrays

img = load("../../assets/waterfall.png")

# We import DitherPunk's internal function `get_colorscheme` to obtain a color scheme:
# We use ColorQuantization's `KMeansQuantization` to obtain a color scheme:
ncolors = 16
cs = DitherPunk.get_colorscheme(img, ncolors)
cs = quantize(Lab, img, KMeansQuantization(ncolors))
cs = sort(cs; by=c -> -c.l)
# The first three colors are white-ish and correspond to the water.

Expand Down

0 comments on commit 1f9ba36

Please sign in to comment.