Initial commit

This commit is contained in:
Dimitri Lozeve 2023-03-16 22:11:38 +01:00
commit 4173ad64a1
4 changed files with 1095 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*\~

1061
colormaps.bqn Normal file

File diff suppressed because it is too large Load diff

12
colors.bqn Normal file
View 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:
cv×s
xc×1-|1-2|h÷60
mv-c
rgb(h÷60)cx0,xc0,0cx,0xc,x0c,c0x
m+rgb
}

21
pnm.bqn Normal file
View file

@ -0,0 +1,21 @@
PBM, PGM, PPM
Dims{' '˘•Fmt¨2𝕩}
# Plain Portable Bit Map (PBM) format (black and white).
# 𝕩 is a 2D boolean matrix: 1 is black, 0 is white.
# https://netpbm.sourceforge.net/doc/pbm.html
PBM{"P1"(Dims𝕩)((@+10)˘•Fmt¨𝕩)}
# Plain Portable Gray Map (PGM) format (grayscale).
# 𝕩 is a 2D matrix, with an arbitrary maximum value.
# The maximum value is white, 0 is black, and gray in between.
# https://netpbm.sourceforge.net/doc/pgm.html
PGM{"P2"(Dims𝕩)" "(•Fmt´𝕩)' '˘(@+10)˘•Fmt¨𝕩}
# Plain Portable Pixel Map (PPM) format (color).
# 𝕩 is an array of shape m‿n‿3, where each triplet is an RGB color.
# Maximum value can be arbitrary.
# https://netpbm.sourceforge.net/doc/ppm.html
PPM{"P3"(Dims𝕩)" "(•Fmt´𝕩)(@+10)(' '¨)¨•Fmt¨¨𝕩}