-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Labels
Description
using ImageCore
using OffsetArrays
function colorwheel(sz::Dims{2}, v=1)
# H, S
canvas = OffsetArrays.centered(fill(ARGB(0, 0, 0, 0), sz))
for I in CartesianIndices(canvas)
x, y = I.I ./ (size(canvas) .÷ 2)
r = sqrt(x*x+y*y)
if r < 1
h = atand(x, y) + 90
canvas[I] = RGB(HSV(h, r, v))
end
end
return canvas
end
colorwheel((1024, 1024))This generates the widely used color wheel https://commons.wikimedia.org/wiki/File:Color_circle_(RGB).svg
I use this for visualization test purposes. I'm wondering if this should be put here or TestImages.
t-bltgadrhill
