Skip to content

Commit

Permalink
Formatting fixes
Browse files Browse the repository at this point in the history
Skip formatting of LazyModules' imports with JuliaFormatter
  • Loading branch information
adrhill committed Jul 27, 2022
1 parent ba7d73a commit 3a15890
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/literate/color_cycling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cs = sort(cs; by=c -> -c.l)

# Let's look at the dithered result using `color_error_multiplier=1.0`
# for a more visible dithering pattern:
d1 = dither(img, Bayer(;color_error_multiplier=1.0), cs)
d1 = dither(img, Bayer(; color_error_multiplier=1.0), cs)

# We create two more frames by cycling the first three colors
d2 = IndirectArray(d1.index, cs[[3, 1, 2, 4:end...]])
Expand Down
2 changes: 2 additions & 0 deletions src/DitherPunk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ using Random
using IndirectArrays
using ColorSchemes
using LazyModules
#! format: off
@lazy import Clustering = "aaaa29a8-35af-508c-8bc3-b662a17a0fe5"
@lazy import UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228"
#! format: on

abstract type AbstractDither end

Expand Down
2 changes: 1 addition & 1 deletion src/clustering.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function get_colorscheme(

# Clustering on the downsampled image already generates good enough colormap estimation
# This significantly reduces the algorithmic complexity.
img = _restrict_to(img, ncolors*100)
img = _restrict_to(img, ncolors * 100)
data = reshape(channelview(Lab.(img)), 3, :)
R = Clustering.kmeans(data, ncolors; maxiter=maxiter, tol=tol)

Expand Down

0 comments on commit 3a15890

Please sign in to comment.