Initial commit
This commit is contained in:
commit
4173ad64a1
4 changed files with 1095 additions and 0 deletions
12
colors.bqn
Normal file
12
colors.bqn
Normal file
|
@ -0,0 +1,12 @@
|
|||
⟨HSVtoRGB⟩⇐
|
||||
|
||||
# Convert colors from HSV to RGB.
|
||||
# 𝕩 is a triple 0 ≤ h‿s‿v ≤ 360‿1‿1
|
||||
# Output is a triple 0 ≤ r‿g‿b ≤ 1
|
||||
HSVtoRGB←{𝕊⟨h,s,v⟩:
|
||||
c←v×s
|
||||
x←c×1-|1-2|h÷60
|
||||
m←v-c
|
||||
r‿g‿b←(⌊h÷60)⊑⟨c‿x‿0,x‿c‿0,0‿c‿x,0‿x‿c,x‿0‿c,c‿0‿x⟩
|
||||
m+r‿g‿b
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue