Skip to content

Commit

Permalink
aspire
Browse files Browse the repository at this point in the history
  • Loading branch information
vmchale committed Sep 19, 2024
1 parent d0f8281 commit 4ce77cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions color/hsi.🍎
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- convert rgb image->hsi
⸎ h ← λr.λg.λb. {h ← acos.((r-g)+(r-b)%(2*√((r-g)^2+(r-b)*(r-g)))); ?b>g,.2*𝜋*h,.h};
-- https://en.wikipedia.org/wiki/RGB_color_model#Numeric_representations
⸎ h ← λr.λg.λb. {h ← acos. ((r-g)+(r-b)%(2*√((r-g)^2+(r-b)*(r-g)))); ?b>g,.2*𝜋-h,.h};
pix ← (λrgb. {r ⟜rgb->1; g ⟜ rgb->2; b ⟜ rgb->3;(r+g+b%3, 1-3%(r+g+b)*(r⋊g⋊b), 1.0)});
λimg. pix`{0} (img :: Arr (i × j) (float * float * float))
-- https://en.wikipedia.org/wiki/RGB_color_model#Numeric_representations

0 comments on commit 4ce77cf

Please sign in to comment.