#Bot Spam
1 messages ยท Page 2 of 1
I was contemplating it the other day, but freaked out a little over how much code I'd need to translate
Ooo
&lerpClamped(1,2,0)
2.0
clamp(lerp(${1}, ${2}, ${3}), ${2}, ${3})
Owner: @bright dock
oh it just gets the l
int L = (int) (0.299D * ((pixel) & 0xFF) + 0.587D * ((pixel >> 8) & 0xFF) + 0.114D * ((pixel >> 16) & 0xFF))
.function show clampedLerp
if(
less(${1},0),
${2},
if(
less(1,${1}),
${3},
lerp(${1}, ${2}, ${3})
)
)
Owner: @bright dock
Function lerpClamped() removed!
&clampedLerp(1,1,0)
0.0
&clampedLerp(0,1,0)
1.0
&clampedLerp(0.25,10,0)
7.5
Oooh, yeah those are eye-accurate weights (I think)
for hue those are branches
if cmax = R then hue is equal to the very top equation
R' = R/255
G' = G/255
B' = B/255
Cmax = max(R', G', B')
Cmin = min(R', G', B')
ฮ = Cmax - Cmin
that actually seems pretty simple
can use the storage system or an array for storing hsv
array(h, s, v)
or storage(1, h), storage(2, s), storage(3, v)
execute(store(1, h), execute(store(2, s), execute(store(3, v))), ...)
That looks actually reasonable, I was freaking out a little over reading Java swing's ColorModelHSV.HSVtoRGB switch
its store not storage, storage is the getter
i could probably whip this up
fun little project woo
Let's goooo
mod()
yes

The color sqerp solution is better utilized if you have a gradient map involved, honestly
going to be using this
as % in java is the remainder operator
not modulo
&mod(4, 3)
0
0
1
&mod(5, 3)
2
0
1
oh im just dumb
5 % 1 = 0
5 % 2 = 1
5 % 3 = 2
5 % 4 = 1
5 % 5 = 0
i forgot you normally increment the first number not the 2nd
ticks % x == 0
i made a crucial change
store and storage keys are no longer integers
they are strings
which means, PROPER VARIABLE NAMES
&execute(store(test, hi), storage(test))
hi
.function add hsv execute(
store(red, and(rshift(${1}, 16), hex(FF))),
execute(
store(green, and(rshift(${1}, 8), hex(FF))),
execute(
store(blue, and(${1}, hex(FF))),
execute(
store(cmax, max(storage(red), max(storage(green), storage(blue)))),
execute(
store(cmin, min(storage(red), min(storage(green), storage(blue)))),
execute(
store(d, sub(storage(max), storage(min))),
execute(
store(
H,
if(
equal(storage(cmax), storage(red)),
mul(60, mod(div(sub(storage(green), storage(blue)), storage(d)), 6)),
if(
equal(storage(cmax), storage(green)),
mul(60, add(div(sub(storage(green), storage(blue)), storage(d)), 2)),
mul(60, add(div(sub(storage(red), storage(green)), storage(d)), 4)),
)
)
),
execute(
store(
S,
if(
equal(storage(cmax), 0),
0,
div(storage(d), storage(cmax))
)
),
array(storage(H), storage(S), storage(cmax))
)
)
)
)
)
)
)
)
Added Function: hsv()

this is a chonker
wheeled the bad boy in
&hsv(hex(#AABBCC))
java.lang.NumberFormatException: For input string: "#AABBCC" under radix 16
in function:
hex()
lol
&hsv(hex(7F7F00))
java.lang.NullPointerException: Cannot invoke "Object.toString()" because "l" is null
in function:
sub()
ugh
&color(hex(7F7F00))
Not enough supplied arguments in the function:
color()
&color(hex(7F7F00),hi9)
hi9
debugging this is gonna suck
i know what i did
.function add hsv execute(
store(red, and(rshift(${1}, 16), hex(FF))),
execute(
store(green, and(rshift(${1}, 8), hex(FF))),
execute(
store(blue, and(${1}, hex(FF))),
execute(
store(cmax, max(storage(red), max(storage(green), storage(blue)))),
execute(
store(cmin, min(storage(red), min(storage(green), storage(blue)))),
execute(
store(d, sub(storage(cmax), storage(cmin))),
execute(
store(
H,
if(
equal(storage(cmax), storage(red)),
mul(60, mod(div(sub(storage(green), storage(blue)), storage(d)), 6)),
if(
equal(storage(cmax), storage(green)),
mul(60, add(div(sub(storage(green), storage(blue)), storage(d)), 2)),
mul(60, add(div(sub(storage(red), storage(green)), storage(d)), 4)),
)
)
),
execute(
store(
S,
if(
equal(storage(cmax), 0),
0,
div(storage(d), storage(cmax))
)
),
array(storage(H), storage(S), storage(cmax))
)
)
)
)
)
)
)
)
Added Function: hsv()
&hsv(hex(AABBCC))
java.lang.NumberFormatException: For input string: "-0.5"
in function:
mod()
really
.function add hsv execute(
store(red, and(rshift(${1}, 16), hex(FF))),
execute(
store(green, and(rshift(${1}, 8), hex(FF))),
execute(
store(blue, and(${1}, hex(FF))),
execute(
store(cmax, max(storage(red), max(storage(green), storage(blue)))),
execute(
store(cmin, min(storage(red), min(storage(green), storage(blue)))),
execute(
store(d, sub(storage(cmax), storage(cmin))),
execute(
store(
H,
if(
equal(storage(cmax), storage(red)),
mul(60, mod(long(div(sub(storage(green), storage(blue)), storage(d))), 6)),
if(
equal(storage(cmax), storage(green)),
mul(60, add(div(sub(storage(green), storage(blue)), storage(d)), 2)),
mul(60, add(div(sub(storage(red), storage(green)), storage(d)), 4)),
)
)
),
execute(
store(
S,
if(
equal(storage(cmax), 0),
0,
div(storage(d), storage(cmax))
)
),
array(storage(H), storage(S), storage(cmax))
)
)
)
)
)
)
)
)
Added Function: hsv()
&hsv(hex(AABBCC))
[210.0, 0.16666666666666666, 204.0]
&exRed(hex(AABBCC))
170
Oooh, you're checking HSV values not RGB
yea
im not sure why v is wrong
Value calculation: V = Cmax
wait
shouldnt cmax be 170
no im confused
wait yeah
cmax should be AA
&and(lshift(hex(AA0000), 16), hex(FF))
0
&and(rshift(hex(AA0000), 16), hex(FF))
170
.function add hsv execute(
store(red, div(and(rshift(${1}, 16), hex(FF)), 255)),
execute(
store(green, div(and(rshift(${1}, 8), hex(FF)), 255)),
execute(
store(blue, div(and(${1}, hex(FF)), 255)),
execute(
store(cmax, max(storage(red), max(storage(green), storage(blue)))),
execute(
store(cmin, min(storage(red), min(storage(green), storage(blue)))),
execute(
store(d, sub(storage(cmax), storage(cmin))),
execute(
store(
H,
if(
equal(storage(cmax), storage(red)),
mul(60, mod(long(div(sub(storage(green), storage(blue)), storage(d))), 6)),
if(
equal(storage(cmax), storage(green)),
mul(60, add(div(sub(storage(green), storage(blue)), storage(d)), 2)),
mul(60, add(div(sub(storage(red), storage(green)), storage(d)), 4)),
)
)
),
execute(
store(
S,
if(
equal(storage(cmax), 0),
0,
div(storage(d), storage(cmax))
)
),
array(storage(H), storage(S), storage(cmax))
)
)
)
)
)
)
)
)
Added Function: hsv()
&hsv(hex(AABBCC))
[210.00000000000003, 0.16666666666666677, 0.8]
right
V is a percentage
80 = 80%
S is also a percentage
17 = 17%
so its official, we have hsv color space ๐
now we need to convert it to the other way!
hsv -> hex
RGB to HSV (or HSB) color code converter and conversion formula.
looks like i missed a case
when d is 0, H is 0
.function add hsv execute(
store(red, div(and(rshift(${1}, 16), hex(FF)), 255)),
execute(
store(green, div(and(rshift(${1}, 8), hex(FF)), 255)),
execute(
store(blue, div(and(${1}, hex(FF)), 255)),
execute(
store(cmax, max(storage(red), max(storage(green), storage(blue)))),
execute(
store(cmin, min(storage(red), min(storage(green), storage(blue)))),
execute(
store(d, sub(storage(cmax), storage(cmin))),
execute(
store(
H,
if(
equal(storage(d), 0),
0,
if(
equal(storage(cmax), storage(red)),
mul(60, mod(long(div(sub(storage(green), storage(blue)), storage(d))), 6)),
if(
equal(storage(cmax), storage(green)),
mul(60, add(div(sub(storage(green), storage(blue)), storage(d)), 2)),
mul(60, add(div(sub(storage(red), storage(green)), storage(d)), 4)),
)
)
)
),
execute(
store(
S,
if(
equal(storage(cmax), 0),
0,
div(storage(d), storage(cmax))
)
),
array(storage(H), storage(S), storage(cmax))
)
)
)
)
)
)
)
)
Added Function: hsv()
that's a good mathematical model of the javax swing impl
,eval rarray([a, b, c])
[Ljava.lang.String;@53742f12
[a, b, c]
cool
behind the scenes here, rarray is converting a string into an array to be parsed by other functions properly
so index() can work right
usually its not necessary as the .toString() happens when showing the output
but theres some odd ball cases where .toString() gets invoked in the pipeline
one case is with user defined functions
so my hsv function will output a String instead of an array
this is where rarray comes into play
actually my mistake
its not the result of a function
its parameters passed into these functions
so if i make a function hsv2rgb and you use hsv() as a param, it will need rarray
hsv2rgb needs to contain the rarray in its definition
so it would take in an argument like this: rarray(${1})
normally this isnt a problem because functions have various parsing going on, such as Long.parseLong or Double.parseDouble
anyway i can get started after i push to prod
.eval rarray([a, b, c])
[a, b, c]
cool
looks like i need an abs function
but i think i can just construct one
sqrt(pow(x, 2))
.function add abs sqrt(pow(${1}, 2))
Added Function: abs()
&abs(-5)
5.0
very cool
.function add hsv2rgb execute(
storage(hsv, rarray(${1})),
execute(
storage(H, index(storage(hsv), 0)),
execute(
storage(S, index(storage(hsv), 1)),
execute(
storage(V, index(storage(hsv), 2)),
execute(
store(C, mul(storage(V), storage(S))),
execute(
store(X, mul(storage(C), sub(1, abs(sub(mod(div(storage(H), 60), 2), 1))))),
execute(
store(m, sub(storage(V), storage(C))),
execute(
store(
rgb,
if(
less(storage(H), 60),
array(storage(C), storage(X), 0),
if(
less(storage(H), 120),
array(storage(X), storage(C), 0),
if(
less(storage(H), 180),
array(0, storage(C), storage(X)),
if(
less(storage(H), 240),
array(0, storage(X), storage(C)),
if(
less(storage(H), 300),
array(storage(X), 0, storage(C)),
array(storage(C), 0, storage(X)),
)
)
)
)
)
),
and(
mul(add(index(storage(rgb), 0), storage(m)), hex(FF)),
and(
mul(add(index(storage(rgb), 1), storage(m)), hex(FF)),
mul(add(index(storage(rgb), 2), storage(m)), hex(FF))
)
)
)
)
)
)
)
)
)
)
Added Function: hsv2rgb()
Bad Argument Type in function:
index()
class java.lang.String cannot be cast to class java.util.List (java.lang.String and java.util.List are in module java.base of loader 'bootstrap')
hmm
im not sure whats getting converted to a string
.function add test execute(
store(x, rarray(${1})),
index(storage(x), 0)
)
Added Function: test()
&test([a, b])
a
.function add hsv2rgb execute(
storage(hsv, rarray(${1})),
execute(
storage(H, index(storage(hsv), 0)),
execute(
storage(S, index(storage(hsv), 1)),
execute(
storage(V, index(storage(hsv), 2)),
execute(
store(C, mul(storage(V), storage(S))),
execute(
store(X, mul(storage(C), sub(1, abs(sub(mod(div(storage(H), 60), 2), 1))))),
execute(
store(m, sub(storage(V), storage(C))),
execute(
store(
rgb,
if(
less(storage(H), 60),
array(storage(C), storage(X), 0),
if(
less(storage(H), 120),
array(storage(X), storage(C), 0),
if(
less(storage(H), 180),
array(0, storage(C), storage(X)),
if(
less(storage(H), 240),
array(0, storage(X), storage(C)),
if(
less(storage(H), 300),
array(storage(X), 0, storage(C)),
array(storage(C), 0, storage(X)),
)
)
)
)
)
),
test
)
)
)
)
)
)
)
)
Added Function: hsv2rgb()
&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])
Bad Argument Type in function:
index()
class java.lang.String cannot be cast to class java.util.List (java.lang.String and java.util.List are in module java.base of loader 'bootstrap')
what
.function add hsv2rgb execute(
storage(hsv, rarray(${1})),
execute(
storage(H, index(storage(hsv), 0)),
execute(
storage(S, index(storage(hsv), 1)),
execute(
storage(V, index(storage(hsv), 2)),
execute(
store(C, mul(storage(V), storage(S))),
execute(
store(X, mul(storage(C), sub(1, abs(sub(mod(div(storage(H), 60), 2), 1))))),
execute(
store(m, sub(storage(V), storage(C))),
execute(
store(
rgb,
if(
less(storage(H), 60),
array(storage(C), storage(X), 0),
if(
less(storage(H), 120),
array(storage(X), storage(C), 0),
if(
less(storage(H), 180),
array(0, storage(C), storage(X)),
if(
less(storage(H), 240),
array(0, storage(X), storage(C)),
if(
less(storage(H), 300),
array(storage(X), 0, storage(C)),
array(storage(C), 0, storage(X)),
)
)
)
)
)
)
),
and(
mul(add(index(storage(rgb), 0), storage(m)), hex(FF)),
and(
mul(add(index(storage(rgb), 1), storage(m)), hex(FF)),
mul(add(index(storage(rgb), 2), storage(m)), hex(FF))
)
)
)
)
)
)
)
)
)
Added Function: hsv2rgb()
&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])
Bad Argument Type in function:
index()
class java.lang.String cannot be cast to class java.util.List (java.lang.String and java.util.List are in module java.base of loader 'bootstrap')
&test([210.00000000000003, 0.16666666666666677, 0.8])
210.00000000000003
.function add hsv2rgb execute(
storage(hsv, rarray(${1})),
execute(
storage(H, index(storage(hsv), 0)),
execute(
storage(S, index(storage(hsv), 1)),
execute(
storage(V, index(storage(hsv), 2)),
execute(
store(C, mul(storage(V), storage(S))),
execute(
store(X, mul(storage(C), sub(1, abs(sub(mod(div(storage(H), 60), 2), 1))))),
execute(
store(m, sub(storage(V), storage(C))),
execute(
test, test
)
)
)
)
)
)
)
)
Added Function: hsv2rgb()
&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])
Bad Argument Type in function:
index()
class java.lang.String cannot be cast to class java.util.List (java.lang.String and java.util.List are in module java.base of loader 'bootstrap')
ah i know what it is
store vs storage
.function add hsv2rgb execute(
store(hsv, rarray(${1})),
execute(
store(H, index(storage(hsv), 0)),
execute(
store(S, index(storage(hsv), 1)),
execute(
store(V, index(storage(hsv), 2)),
execute(
store(C, mul(storage(V), storage(S))),
execute(
store(X, mul(storage(C), sub(1, abs(sub(mod(div(storage(H), 60), 2), 1))))),
execute(
store(m, sub(storage(V), storage(C))),
execute(
store(
rgb,
if(
less(storage(H), 60),
array(storage(C), storage(X), 0),
if(
less(storage(H), 120),
array(storage(X), storage(C), 0),
if(
less(storage(H), 180),
array(0, storage(C), storage(X)),
if(
less(storage(H), 240),
array(0, storage(X), storage(C)),
if(
less(storage(H), 300),
array(storage(X), 0, storage(C)),
array(storage(C), 0, storage(X)),
)
)
)
)
)
),
and(
mul(add(index(storage(rgb), 0), storage(m)), hex(FF)),
and(
mul(add(index(storage(rgb), 1), storage(m)), hex(FF)),
mul(add(index(storage(rgb), 2), storage(m)), hex(FF))
)
)
)
)
)
)
)
)
)
)
Added Function: hsv2rgb()
&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])
Index out of bounds: 1
execute(
store(x, rarray(${1})),
index(storage(x), 0)
)
Owner: @night bane
.function add test execute(
store(x, rarray(${1})),
index(storage(x), 1)
)
Added Function: test()
&test([210.00000000000003, 0.16666666666666677, 0.8])
Index out of bounds: 1
index(array(->${1}, ->${2}), 1)
Owner: @night bane
ok apparently the pipeline is striping out the escape character
whatever
easy fix
&test([210.00000000000003, 0.16666666666666677, 0.8])
0.16666666666666677
&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])
java.lang.NumberFormatException: For input string: "3.5000000000000004"
in function:
mod()
erg
.function add hsv2rgb execute(
store(hsv, rarray(${1})),
execute(
store(H, index(storage(hsv), 0)),
execute(
store(S, index(storage(hsv), 1)),
execute(
store(V, index(storage(hsv), 2)),
execute(
store(C, mul(storage(V), storage(S))),
execute(
store(X, mul(storage(C), sub(1, abs(sub(mod(long(div(storage(H), 60)), 2), 1))))),
execute(
store(m, sub(storage(V), storage(C))),
execute(
store(
rgb,
if(
less(storage(H), 60),
array(storage(C), storage(X), 0),
if(
less(storage(H), 120),
array(storage(X), storage(C), 0),
if(
less(storage(H), 180),
array(0, storage(C), storage(X)),
if(
less(storage(H), 240),
array(0, storage(X), storage(C)),
if(
less(storage(H), 300),
array(storage(X), 0, storage(C)),
array(storage(C), 0, storage(X)),
)
)
)
)
)
),
and(
mul(add(index(storage(rgb), 0), storage(m)), hex(FF)),
and(
mul(add(index(storage(rgb), 1), storage(m)), hex(FF)),
mul(add(index(storage(rgb), 2), storage(m)), hex(FF))
)
)
)
)
)
)
)
)
)
)
Added Function: hsv2rgb()
&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])
Bad Argument Type in function:
index()
class java.lang.String cannot be cast to class java.util.List (java.lang.String and java.util.List are in module java.base of loader 'bootstrap')
.function add hsv2rgb execute(
store(hsv, rarray(${1})),
execute(
store(H, index(storage(hsv), 0)),
execute(
store(S, index(storage(hsv), 1)),
execute(
store(V, index(storage(hsv), 2)),
execute(
store(C, mul(storage(V), storage(S))),
execute(
store(X, mul(storage(C), sub(1, abs(sub(mod(long(div(storage(H), 60)), 2), 1))))),
execute(
store(m, sub(storage(V), storage(C))),
execute(
store(
rgb,
if(
less(storage(H), 60),
array(storage(C), storage(X), 0),
if(
less(storage(H), 120),
array(storage(X), storage(C), 0),
if(
less(storage(H), 180),
array(0, storage(C), storage(X)),
if(
less(storage(H), 240),
array(0, storage(X), storage(C)),
if(
less(storage(H), 300),
array(storage(X), 0, storage(C)),
array(storage(C), 0, storage(X)),
)
)
)
)
)
),
test
)
)
)
)
)
)
)
)
Added Function: hsv2rgb()
&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])
test
ok
spot the problem
.toString !
oh i see
it runs eval
it has to be a string
.function add hsv2rgb execute(
store(hsv, rarray(${1})),
execute(
store(H, index(storage(hsv), 0)),
execute(
store(S, index(storage(hsv), 1)),
execute(
store(V, index(storage(hsv), 2)),
execute(
store(C, mul(storage(V), storage(S))),
execute(
store(X, mul(storage(C), sub(1, abs(sub(mod(long(div(storage(H), 60)), 2), 1))))),
execute(
store(m, sub(storage(V), storage(C))),
execute(
if(
less(storage(H), 60),
->store(rgb, array(storage(C), storage(X), 0)),
->if(
less(storage(H), 120),
->store(rgb, array(storage(X), storage(C), 0)),
->if(
less(storage(H), 180),
->store(rgb, array(0, storage(C), storage(X))),
->if(
less(storage(H), 240),
->store(rgb, array(0, storage(X), storage(C))),
->if(
less(storage(H), 300),
->store(rgb, array(storage(X), 0, storage(C))),
->store(rgb, array(storage(C), 0, storage(X))),
)
)
)
)
),
and(
mul(add(index(storage(rgb), 0), storage(m)), hex(FF)),
and(
mul(add(index(storage(rgb), 1), storage(m)), hex(FF)),
mul(add(index(storage(rgb), 2), storage(m)), hex(FF))
)
)
)
)
)
)
)
)
)
)
Added Function: hsv2rgb()
&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])
java.lang.NumberFormatException: For input string: "204.0"
in function:
and()
.function add hsv2rgb execute(
store(hsv, rarray(${1})),
execute(
store(H, index(storage(hsv), 0)),
execute(
store(S, index(storage(hsv), 1)),
execute(
store(V, index(storage(hsv), 2)),
execute(
store(C, mul(storage(V), storage(S))),
execute(
store(X, mul(storage(C), sub(1, abs(sub(mod(long(div(storage(H), 60)), 2), 1))))),
execute(
store(m, sub(storage(V), storage(C))),
execute(
if(
less(storage(H), 60),
->store(rgb, array(storage(C), storage(X), 0)),
->if(
less(storage(H), 120),
->store(rgb, array(storage(X), storage(C), 0)),
->if(
less(storage(H), 180),
->store(rgb, array(0, storage(C), storage(X))),
->if(
less(storage(H), 240),
->store(rgb, array(0, storage(X), storage(C))),
->if(
less(storage(H), 300),
->store(rgb, array(storage(X), 0, storage(C))),
->store(rgb, array(storage(C), 0, storage(X))),
)
)
)
)
),
and(
long(mul(add(index(storage(rgb), 0), storage(m)), hex(FF))),
and(
long(mul(add(index(storage(rgb), 1), storage(m)), hex(FF))),
long(mul(add(index(storage(rgb), 2), storage(m)), hex(FF)))
)
)
)
)
)
)
)
)
)
)
Added Function: hsv2rgb()
&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])
136
11189196
ah
i forgot to bit shift
.function add hsv2rgb execute(
store(hsv, rarray(${1})),
execute(
store(H, index(storage(hsv), 0)),
execute(
store(S, index(storage(hsv), 1)),
execute(
store(V, index(storage(hsv), 2)),
execute(
store(C, mul(storage(V), storage(S))),
execute(
store(X, mul(storage(C), sub(1, abs(sub(mod(long(div(storage(H), 60)), 2), 1))))),
execute(
store(m, sub(storage(V), storage(C))),
execute(
if(
less(storage(H), 60),
->store(rgb, array(storage(C), storage(X), 0)),
->if(
less(storage(H), 120),
->store(rgb, array(storage(X), storage(C), 0)),
->if(
less(storage(H), 180),
->store(rgb, array(0, storage(C), storage(X))),
->if(
less(storage(H), 240),
->store(rgb, array(0, storage(X), storage(C))),
->if(
less(storage(H), 300),
->store(rgb, array(storage(X), 0, storage(C))),
->store(rgb, array(storage(C), 0, storage(X))),
)
)
)
)
),
and(
lshift(long(mul(add(index(storage(rgb), 0), storage(m)), hex(FF))), 16),
and(
lshift(long(mul(add(index(storage(rgb), 1), storage(m)), hex(FF))), 8),
long(mul(add(index(storage(rgb), 2), storage(m)), hex(FF)))
)
)
)
)
)
)
)
)
)
)
Added Function: hsv2rgb()
&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])
0
what
ah yes
and
should be or
.function add hsv2rgb execute(
store(hsv, rarray(${1})),
execute(
store(H, index(storage(hsv), 0)),
execute(
store(S, index(storage(hsv), 1)),
execute(
store(V, index(storage(hsv), 2)),
execute(
store(C, mul(storage(V), storage(S))),
execute(
store(X, mul(storage(C), sub(1, abs(sub(mod(long(div(storage(H), 60)), 2), 1))))),
execute(
store(m, sub(storage(V), storage(C))),
execute(
if(
less(storage(H), 60),
->store(rgb, array(storage(C), storage(X), 0)),
->if(
less(storage(H), 120),
->store(rgb, array(storage(X), storage(C), 0)),
->if(
less(storage(H), 180),
->store(rgb, array(0, storage(C), storage(X))),
->if(
less(storage(H), 240),
->store(rgb, array(0, storage(X), storage(C))),
->if(
less(storage(H), 300),
->store(rgb, array(storage(X), 0, storage(C))),
->store(rgb, array(storage(C), 0, storage(X))),
)
)
)
)
),
or(
lshift(long(mul(add(index(storage(rgb), 0), storage(m)), hex(FF))), 16),
or(
lshift(long(mul(add(index(storage(rgb), 1), storage(m)), hex(FF))), 8),
long(mul(add(index(storage(rgb), 2), storage(m)), hex(FF)))
)
)
)
)
)
)
)
)
)
)
Added Function: hsv2rgb()
&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])
11193548
&hex(AABBCC)
11189196
pretty damn close
but i think its good enough!
&concat(exRed(11193548), exGreen(11193548), exBlue(11193548))
170204204
&tohex(11193548)
aacccc
&tohex(11193548)
AACCCC
funny how it lost some data
or rather, its inaccurate
but its close enough to the point where it doesnt really matter
&tohex(hsv2rgb(hsv(AABBCC)))
java.lang.NumberFormatException: For input string: "AABBCC"
in function:
rshift()
&tohex(hsv2rgb(hsv(hex(AABBCC))))
AACCCC
&tohex(hsv2rgb(hsv(hex(FFFFFF))))
FFFFFF
&tohex(hsv2rgb(hsv(hex(000000))))
0
&tohex(hsv2rgb(hsv(hex(123456))))
115656
&color(tohex(hsv2rgb(hsv(hex(FFFFFF)))), hi)
java.lang.NumberFormatException: For input string: "FFFFFF"
in function:
color()
&color(hsv2rgb(hsv(hex(FFFFFF))), hi)
hi
&color(hsv2rgb(hsv(hex(123456))), hi)
hi
&color(hex(123456))
Not enough supplied arguments in the function:
color()
&color(hex(123456), hi)
hi
ok thats a pretty big difference
.function add hsv2rgb execute(
store(hsv, rarray(${1})),
execute(
store(H, index(storage(hsv), 0)),
execute(
store(S, index(storage(hsv), 1)),
execute(
store(V, index(storage(hsv), 2)),
execute(
store(C, mul(storage(V), storage(S))),
execute(
store(X, mul(storage(C), sub(1, abs(sub(mod(long(div(storage(H), 60)), 2), 1))))),
execute(
store(m, sub(storage(V), storage(C))),
execute(
if(
less(storage(H), 60),
->store(rgb, array(storage(C), storage(X), 0)),
->if(
less(storage(H), 120),
->store(rgb, array(storage(X), storage(C), 0)),
->if(
less(storage(H), 180),
->store(rgb, array(0, storage(C), storage(X))),
->if(
less(storage(H), 240),
->store(rgb, array(0, storage(X), storage(C))),
->if(
less(storage(H), 300),
->store(rgb, array(storage(X), 0, storage(C))),
->store(rgb, array(storage(C), 0, storage(X))),
)
)
)
)
),
or(
lshift(round(mul(add(index(storage(rgb), 0), storage(m)), hex(FF))), 16),
or(
lshift(round(mul(add(index(storage(rgb), 1), storage(m)), hex(FF))), 8),
round(mul(add(index(storage(rgb), 2), storage(m)), hex(FF)))
)
)
)
)
)
)
)
)
)
)
Added Function: hsv2rgb()
&color(hex(123456), hi)
hi
&color(hsv2rgb(hsv(hex(123456))), hi)
hi
&hsv2rgb(hsv(hex(123456))
Not enough arguments!
&hsv2rgb(hsv(hex(123456)))
1201750
&hsv(hex(123456))
[210.0, 0.7906976744186047, 0.33725490196078434]
see thats pretty accurate
so my hsv -> rgb conversion has an inaccuracy somewhere
.function add hsv2rgb execute(
store(hsv, rarray(${1})),
execute(
store(H, index(storage(hsv), 0)),
execute(
store(S, index(storage(hsv), 1)),
execute(
store(V, index(storage(hsv), 2)),
execute(
store(C, mul(storage(V), storage(S))),
execute(
store(X, mul(storage(C), sub(1, abs(sub(mod(round(div(storage(H), 60)), 2), 1))))),
execute(
store(m, sub(storage(V), storage(C))),
execute(
if(
less(storage(H), 60),
->store(rgb, array(storage(C), storage(X), 0)),
->if(
less(storage(H), 120),
->store(rgb, array(storage(X), storage(C), 0)),
->if(
less(storage(H), 180),
->store(rgb, array(0, storage(C), storage(X))),
->if(
less(storage(H), 240),
->store(rgb, array(0, storage(X), storage(C))),
->if(
less(storage(H), 300),
->store(rgb, array(storage(X), 0, storage(C))),
->store(rgb, array(storage(C), 0, storage(X))),
)
)
)
)
),
or(
lshift(round(mul(add(index(storage(rgb), 0), storage(m)), hex(FF))), 16),
or(
lshift(round(mul(add(index(storage(rgb), 1), storage(m)), hex(FF))), 8),
round(mul(add(index(storage(rgb), 2), storage(m)), hex(FF)))
)
)
)
)
)
)
)
)
)
)
Added Function: hsv2rgb()
&tohex(hsv2rgb(hsv(hex(123456))))
121256
i think its the modulo
mine can only operate on longs
i think i need one for doubles
ok i guess we use %
bah
.function add hsv2rgb execute(
store(hsv, rarray(${1})),
execute(
store(H, index(storage(hsv), 0)),
execute(
store(S, index(storage(hsv), 1)),
execute(
store(V, index(storage(hsv), 2)),
execute(
store(C, mul(storage(V), storage(S))),
execute(
store(X, mul(storage(C), sub(1, abs(sub(mod(div(storage(H), 60), 2), 1))))),
execute(
store(m, sub(storage(V), storage(C))),
execute(
if(
less(storage(H), 60),
->store(rgb, array(storage(C), storage(X), 0)),
->if(
less(storage(H), 120),
->store(rgb, array(storage(X), storage(C), 0)),
->if(
less(storage(H), 180),
->store(rgb, array(0, storage(C), storage(X))),
->if(
less(storage(H), 240),
->store(rgb, array(0, storage(X), storage(C))),
->if(
less(storage(H), 300),
->store(rgb, array(storage(X), 0, storage(C))),
->store(rgb, array(storage(C), 0, storage(X))),
)
)
)
)
),
or(
lshift(round(mul(add(index(storage(rgb), 0), storage(m)), hex(FF))), 16),
or(
lshift(round(mul(add(index(storage(rgb), 1), storage(m)), hex(FF))), 8),
round(mul(add(index(storage(rgb), 2), storage(m)), hex(FF)))
)
)
)
)
)
)
)
)
)
)
Added Function: hsv2rgb()
&tohex(hsv2rgb(hsv(hex(123456))))
123456
917373
hi
&color(hex(918273), hi)
hi
thats super close
i'll take it
tomorrow we make a function that lerps 2 hsv variables, needs to lerp 3 times for h, s, and v
.function add lerphsv execute(
store(x, rarray(${2}))
execute(
store(y, rarray(${3})),
array(
lerp(${1}, index(storage(x), 1), index(storage(y), 1)),
lerp(${1}, index(storage(x), 2), index(storage(y), 2)),
lerp(${1}, index(storage(x), 3), index(storage(y), 3)),
)
)
)
Added Function: lerphsv()
&hsv(hex(FF0000))
[0.0, 1.0, 1.0]
&hsv(hex(00FF00))
[180.0, 1.0, 1.0]
&lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))
Value must be encased in [ ]
.function add lerphsv execute(
store(x, ${2))
execute(
store(y, ${3}),
array(
lerp(${1}, index(storage(x), 1), index(storage(y), 1)),
lerp(${1}, index(storage(x), 2), index(storage(y), 2)),
lerp(${1}, index(storage(x), 3), index(storage(y), 3)),
)
)
)
Added Function: lerphsv()
&lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))
Bad Argument Type in function:
index()
class java.lang.String cannot be cast to class java.util.List (java.lang.String and java.util.List are in module java.base of loader 'bootstrap')
.function add rarray(${2})
Missing Argument(s): func
.function add lerphsv rarray(${2})
Added Function: lerphsv()
&lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))
[0.0, 1.0, 1.0]
.function add lerphsv execute(
store(x, rarray(${2}))
execute(
store(y, rarray(${3})),
array(
lerp(${1}, index(storage(x), 1), index(storage(y), 1)),
lerp(${1}, index(storage(x), 2), index(storage(y), 2)),
lerp(${1}, index(storage(x), 3), index(storage(y), 3)),
)
)
)
Added Function: lerphsv()
&lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))
Value must be encased in [ ]
Value must be encased in [ ]
&lerphsv(0.5, string(hsv(hex(FF0000))), string(hsv(hex(00FF00))))
Value must be encased in [ ]
&(hsv(hex(FF0000))
(hsv(hex(FF0000))
&hsv(hex(FF0000))
[0.0, 1.0, 1.0]
&lerphsv(0.5, [0.0, 1.0, 1.0], [0.0, 1.0, 1.0])
Value must be encased in [ ]
&lerphsv(0.5, [0.0, 1.0, 1.0], [180.0, 1.0, 1.0])
Value must be encased in [ ]
.function add lerphsv execute(
store(x, rarray(${2}))
execute(
store(y, rarray(${3})),
test
)
)
Added Function: lerphsv()
&lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))
Value must be encased in [ ]
.function add lerphsv execute(
store(x, ${2})
execute(
store(y, ${3}),
storage(x)
)
)
Added Function: lerphsv()
&lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))
Not enough supplied arguments in the function:
execute()
.function add lerphsv execute(
store(x, ${2}),
execute(
store(y, ${3}),
storage(x)
)
)
Added Function: lerphsv()
&lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))
[0.0, 1.0, 1.0]
.function add lerphsv execute(
store(x, rarray(${2})),
execute(
store(y, rarray(${3})),
array(
lerp(${1}, index(storage(x), 1), index(storage(y), 1)),
lerp(${1}, index(storage(x), 2), index(storage(y), 2)),
lerp(${1}, index(storage(x), 3), index(storage(y), 3)),
)
)
)
Added Function: lerphsv()
&lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))
Index out of bounds: 3
.function add lerphsv execute(
store(x, rarray(${2})),
execute(
store(y, rarray(${3})),
array(
lerp(${1}, index(storage(x), 0), index(storage(y), 0)),
lerp(${1}, index(storage(x), 1), index(storage(y), 1)),
lerp(${1}, index(storage(x), 2), index(storage(y), 2)),
)
)
)
Added Function: lerphsv()
&lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))
[90.0, 1.0, 1.0]
80FF00
&color(hsv2rgb(lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))), hi)
hi
&color(hsv2rgb(lerphsv(0.75, hsv(hex(FF0000)), hsv(hex(00FF00)))), hi)
hi
&color(hsv2rgb(lerphsv(0.25, hsv(hex(FF0000)), hsv(hex(00FF00)))), hi)
hi
&color(hsv2rgb(lerphsv(0, hsv(hex(FF0000)), hsv(hex(00FF00)))), hi)
hi
&color(hsv2rgb(lerphsv(1, hsv(hex(FF0000)), hsv(hex(00FF00)))), hi)
hi
[180.0, 1.0, 1.0]
&tohex(hsv2rgb(hsv(hex(00FF00))))
FFFF
hi
&hsv(hex(00FF00))
[180.0, 1.0, 1.0]
Value cannot be longer than 1024 characters.
net.dv8tion.jda.api.entities.MessageEmbed$Field.<init>(MessageEmbed.java:986)
net.dv8tion.jda.api.entities.MessageEmbed$Field.<init>(MessageEmbed.java:1008)
tamaized.curse.EvalModule.lambda$new$8(EvalModule.java:233)
tamaized.dbu.command.Commands$Command.execute(Commands.java:196)
tamaized.dbu.command.Commands$Command.execute(Commands.java:162)
Value cannot be longer than 1024 characters.
net.dv8tion.jda.api.entities.MessageEmbed$Field.<init>(MessageEmbed.java:986)
net.dv8tion.jda.api.entities.MessageEmbed$Field.<init>(MessageEmbed.java:1008)
tamaized.curse.EvalModule.lambda$new$6(EvalModule.java:209)
java.base/java.util.HashMap.forEach(HashMap.java:1421)
tamaized.curse.EvalModule.lambda$new$7(EvalModule.java:202)
Code is too large, use the show command instead!
Owner: @night bane
.function show hsv
Output was larger than 2048 characters
Owner: @night bane
.function show hsv
Output was larger than 2048 characters
Owner: @night bane
.function add hsv execute(
store(red, div(and(rshift(${1}, 16), hex(FF)), 255)),
execute(
store(green, div(and(rshift(${1}, 8), hex(FF)), 255)),
execute(
store(blue, div(and(${1}, hex(FF)), 255)),
execute(
store(cmax, max(storage(red), max(storage(green), storage(blue)))),
execute(
store(cmin, min(storage(red), min(storage(green), storage(blue)))),
execute(
store(d, sub(storage(cmax), storage(cmin))),
execute(
store(
H,
if(
equal(storage(d), 0),
0,
if(
equal(storage(cmax), storage(red)),
->mul(60, mod(div(sub(storage(green), storage(blue)), storage(d)), 6)),
if(
equal(storage(cmax), storage(green)),
->mul(60, add(div(sub(storage(blue), storage(red)), storage(d)), 2)),
->mul(60, add(div(sub(storage(red), storage(green)), storage(d)), 4)),
)
)
)
),
execute(
store(
S,
if(
equal(storage(cmax), 0),
0,
->div(storage(d), storage(cmax))
)
),
array(storage(H), storage(S), storage(cmax))
)
)
)
)
)
)
)
)
Added Function: hsv()
&hsv(hex(00FF00))
[120.0, 1.0, 1.0]
hi
&color(hsv2rgb(lerphsv(1, hsv(hex(FF0000)), hsv(hex(00FF00)))), hi)
hi
&color(hsv2rgb(lerphsv(0, hsv(hex(FF0000)), hsv(hex(00FF00)))), hi)
hi
&color(hsv2rgb(lerphsv(0.75, hsv(hex(FF0000)), hsv(hex(00FF00)))), hi)
hi
hi
&color(hsv2rgb(lerphsv(0.75, hsv(hex(FF0000)), hsv(hex(0000FF)))), hi)
hi
&color(hsv2rgb(lerphsv(0.25, hsv(hex(FF0000)), hsv(hex(0000FF)))), hi)
hi
&color(hsv2rgb(lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(FF00FF)))), hi)
hi
&color(hsv2rgb(lerphsv(0, hsv(hex(FF0000)), hsv(hex(FF00FF)))), hi)
hi
&color(hsv2rgb(lerphsv(1, hsv(hex(FF0000)), hsv(hex(FF00FF)))), hi)
hi
&color(hsv2rgb(lerphsv(2, hsv(hex(FF0000)), hsv(hex(FF00FF)))), hi)
hi
&color(hsv2rgb(lerphsv(-0.5, hsv(hex(FF0000)), hsv(hex(FF00FF)))), hi)
hi
&color(hsv2rgb(lerphsv(-1, hsv(hex(FF0000)), hsv(hex(FF00FF)))), hi)
hi
&color(hsv2rgb(lerphsv(-2, hsv(hex(FF0000)), hsv(hex(FF00FF)))), hi)
hi
&color(hsv2rgb(lerphsv(-3, hsv(hex(FF0000)), hsv(hex(FF00FF)))), hi)
hi
&color(hsv2rgb(lerphsv(-4, hsv(hex(FF0000)), hsv(hex(FF00FF)))), hi)
hi
&color(hsv2rgb(lerphsv(-5, hsv(hex(FF0000)), hsv(hex(FF00FF)))), hi)
hi
&color(hsv2rgb(lerphsv(0, hsv(hex(00FF00)), hsv(hex(FF0000)))), hi)
hi
&color(hsv2rgb(lerphsv(0.5, hsv(hex(00FF00)), hsv(hex(FF0000)))), hi)
hi
&color(hsv2rgb(lerphsv(0.75, hsv(hex(00FF00)), hsv(hex(FF0000)))), hi)
hi
&color(hsv2rgb(lerphsv(1, hsv(hex(00FF00)), hsv(hex(FF0000)))), hi)
hi
.function show downloads
concat(
execute(
store(2, string(get(json(request(id(${1}))), data))),
concat(**__, replace(get(ejson(storage(2)), name), ", ->), __**\n\n)
),
execute(
store(1, get(ejson(storage(2)), downloadCount)),
if(
less(0, long(div(storage(1), 1000000000))),
->color(#FF00FF, concat(long(div(storage(1), 1000000000)), B)),
->if(
less(0, long(div(storage(1), 1000000))),
->color(#FFAA00, concat(long(div(storage(1), 1000000)), M)),
->if(
less(0, long(div(storage(1), 1000))),
->color(#FFFF00, concat(long(div(storage(1), 1000)), K)),
->color(#00FF00, storage(1))
)
)
)
),
-> Downloads)
Gets the Download Count of a Project
Owner: @night bane
.function add downloads concat(
execute(
store(2, string(get(json(request(id(${1}))), data))),
concat(__, replace(get(ejson(storage(2)), name), ", ->), __\n\n)
),
execute(
store(1, get(ejson(storage(2)), downloadCount)),
if(
less(0, long(div(storage(1), 1000000000))),
->color(#FF00FF, concat(long(div(storage(1), 1000000000)), B)),
->if(
less(0, long(div(storage(1), 1000000))),
->color(hsv2rgb(lerphsv(0.75, hsv(hex(00FF00)), hsv(hex(FF0000)))), concat(long(div(storage(1), 1000000)), M)),
->if(
less(0, long(div(storage(1), 1000))),
->color(hsv2rgb(lerphsv(0.5, hsv(hex(00FF00)), hsv(hex(FF0000)))), concat(long(div(storage(1), 1000)), K)),
->color(hsv2rgb(lerphsv(0, hsv(hex(00FF00)), hsv(hex(FF0000)))), storage(1))
)
)
)
),
-> Downloads)
Added Function: downloads()
&downloads(asdf)
asdfghjkl๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ
0 Downloads
&downloads(melon golem)
Melon Golem
134K Downloads
&downloads(the twilight)
The Twilight Forest
86M Downloads
&downloads(jei)
Just Enough Items (JEI)
218M Downloads
.function add downloads concat(
execute(
store(2, string(get(json(request(id(${1}))), data))),
concat(__, replace(get(ejson(storage(2)), name), ", ->), __\n\n)
),
execute(
store(1, get(ejson(storage(2)), downloadCount)),
if(
less(0, long(div(storage(1), 1000000000))),
->color(#FF00FF, concat(long(div(storage(1), 1000000000)), B)),
->if(
less(0, long(div(storage(1), 1000000))),
->color(
hsv2rgb(lerphsv(0.75, hsv(hex(00FF00)), hsv(hex(FF0000)))),
concat(long(div(storage(1), 1000000)), M)
),
->if(
less(0, long(div(storage(1), 1000))),
->color(
hsv2rgb(lerphsv(0.5, hsv(hex(00FF00)), hsv(hex(FF0000)))),
concat(long(div(storage(1), 1000)), K)
),
->color(
hsv2rgb(lerphsv(0, hsv(hex(00FF00)), hsv(hex(FF0000)))),
storage(1)
)
)
)
)
),
-> Downloads)
Added Function: downloads()
Value cannot be longer than 1024 characters.
net.dv8tion.jda.api.entities.MessageEmbed$Field.<init>(MessageEmbed.java:986)
net.dv8tion.jda.api.entities.MessageEmbed$Field.<init>(MessageEmbed.java:1008)
tamaized.curse.EvalModule.lambda$new$8(EvalModule.java:241)
tamaized.dbu.command.Commands$Command.execute(Commands.java:196)
tamaized.dbu.command.Commands$Command.execute(Commands.java:162)
1024 ???
.function show rgb
color(random(hex(FFFFFF)), color!)
Owner: @night bane
&olor(hsv2rgb(array(random(360), 1, 1), color!)
olor(hsv2rgb(array(random(360), 1, 1), color!)
&color(hsv2rgb(array(random(360), 1, 1), color!)
java.lang.NumberFormatException: For input string: "hsv2rgb(array(random(360), 1, 1), color!"
in function:
color()
&color(hsv2rgb(array(random(360), 1, 1)), color!)
color!
&color(hsv2rgb(array(random(360), 1, 1)), color!)
color!
.function add rgb color(hsv2rgb(array(random(360), 1, 1)), color!)
Added Function: rgb()
&rgb()
color!
&rgb()
color!
&rgb()
color!
&rgb()
color!
&rgb()
color!
&rgb()
color!
Added Function: rgb()
This is cracked
&rgb(Fabulous!)
Fabulous!
Hell yeah!
i love hsv
Me too, this especially looks like victory 
did you see the hsv lerp i made
&rgb A random color!
rgb A random color!
.function show hsvlerp
Function doesn't exist!
er
&rgb(A random color!)
A random color!
execute(
store(x, rarray(${2})),
execute(
store(y, rarray(${3})),
array(
lerp(${1}, index(storage(x), 0), index(storage(y), 0)),
lerp(${1}, index(storage(x), 1), index(storage(y), 1)),
lerp(${1}, index(storage(x), 2), index(storage(y), 2)),
)
)
)
Owner: @night bane
takes 2 hsv inputs
Thatโs cool!
.function show downloads
Output was larger than 1024 charactersGets the Download Count of a Project
Owner: @night bane
I applied it here
hsv2rgb(lerphsv(0.5, hsv(hex(00FF00)), hsv(hex(FF0000))))
&hsv2rgb(lerphsv(0.5, hsv(hex(00FF00)), hsv(hex(FF0000))))
16776960
&color(hsv2rgb(lerphsv(0.5, hsv(hex(00FF00)), hsv(hex(FF0000)))))
Not enough supplied arguments in the function:
color()
&color(hsv2rgb(lerphsv(0.5, hsv(hex(00FF00)), hsv(hex(FF0000)))), hi)
hi
I canโt get over how awesome this is
Code is too large, use the show command instead!Gets the Download Count of a Project
Owner: @night bane
Output was larger than 1024 characters
Gets the Download Count of a Project
Owner: @night bane
hi
hm
that should be a dark green no?
&color(hsv2rgb(lerphsv(0.75, hsv(hex(000000)), hsv(hex(FF0000)))), hi)
hi
execute(
store(x, rarray(${2})),
execute(
store(y, rarray(${3})),
array(
lerp(${1}, index(storage(x), 0), index(storage(y), 0)),
lerp(${1}, index(storage(x), 1), index(storage(y), 1)),
lerp(${1}, index(storage(x), 2), index(storage(y), 2)),
)
)
)
Owner: @night bane
&hsv(hex(000000))
[NaN, NaN, 0.0]
0
.function show hsv
Output was larger than 1024 characters
Owner: @night bane
&div(and(rshift(0, 16), hex(FF)), 255)
0.0
&equal(sub(0, 0), 0)
false
huh
how is 0 not equal to 0
i guess its doing Object.equals
&equal(double(storage(d)), 0)
java.lang.NullPointerException: Cannot invoke "Object.toString()" because the return value of "java.util.List.get(int)" is null
in function:
double()
false
&equal(sub(0, 0), double(0))
true
&equal(sub(0, 0), 0.0)
false
ah it thinks its a string!
.function add hsv execute(
store(red, div(and(rshift(${1}, 16), hex(FF)), 255)),
execute(
store(green, div(and(rshift(${1}, 8), hex(FF)), 255)),
execute(
store(blue, div(and(${1}, hex(FF)), 255)),
execute(
store(cmax, max(storage(red), max(storage(green), storage(blue)))),
execute(
store(cmin, min(storage(red), min(storage(green), storage(blue)))),
execute(
store(d, sub(storage(cmax), storage(cmin))),
execute(
store(
H,
if(
equal(storage(d), double(0)),
0,
if(
equal(storage(cmax), storage(red)),
->mul(60, mod(div(sub(storage(green), storage(blue)), storage(d)), 6)),
if(
equal(storage(cmax), storage(green)),
->mul(60, add(div(sub(storage(blue), storage(red)), storage(d)), 2)),
->mul(60, add(div(sub(storage(red), storage(green)), storage(d)), 4)),
)
)
)
),
execute(
store(
S,
if(
equal(storage(cmax), double(0)),
0,
->div(storage(d), storage(cmax))
)
),
array(storage(H), storage(S), storage(cmax))
)
)
)
)
)
)
)
)
Added Function: hsv()
&hsv(hex(000000))
[0, 0, 0.0]
Output was larger than 1024 characters
Owner: @night bane
that one doesnt appear to have the same problem
&color(hsv2rgb(lerphsv(0.75, hsv(hex(000000)), hsv(hex(FF0000)))), hi)
hi
&color(hsv2rgb(lerphsv(0.75, hsv(hex(000000)), hsv(hex(00FF00)))), hi)
hi
&color(hsv2rgb(lerphsv(0.5, hsv(hex(000000)), hsv(hex(00FF00)))), hi)
hi
&color(hsv2rgb(lerphsv(0.25, hsv(hex(000000)), hsv(hex(00FF00)))), hi)
hi
&color(hsv2rgb(lerphsv(0, hsv(hex(000000)), hsv(hex(00FF00)))), hi)
hi
execute(
store(x, rarray(${2})),
execute(
store(y, rarray(${3})),
array(
lerp(${1}, index(storage(x), 0), index(storage(y), 0)),
lerp(${1}, index(storage(x), 1), index(storage(y), 1)),
lerp(${1}, index(storage(x), 2), index(storage(y), 2)),
)
)
)
Owner: @night bane
.function add saturate execute(
store(x, rarray(${2})),
array(
index(storage(x), 0),
lerp(${1}, 0, index(storage(x), 1)),
index(storage(x), 2)
)
)
Added Function: saturate()
&saturate(1, hsv(hex(00FF00)))
[120.0, 1.0, 1.0]
&color(hsv2rgb(saturate(1, hsv(hex(00FF00)))), Result)
Result
&color(hsv2rgb(saturate(0.5, hsv(hex(00FF00)))), Result)
Result
&color(hsv2rgb(saturate(0.25, hsv(hex(00FF00)))), Result)
Result
&color(hsv2rgb(saturate(0, hsv(hex(00FF00)))), Result)
Result
Function saturate() removed!
.function add desaturate execute(
store(x, rarray(${2})),
array(
index(storage(x), 0),
lerp(${1}, 0, index(storage(x), 1)),
index(storage(x), 2)
)
)
Added Function: desaturate()
.function add devalue execute(
store(x, rarray(${2})),
array(
index(storage(x), 0),
index(storage(x), 1),
lerp(${1}, 0, index(storage(x), 2))
)
)
Added Function: devalue()
&color(hsv2rgb(devalue(0, hsv(hex(00FF00)))), Result)
Result
&color(hsv2rgb(devalue(0.25, hsv(hex(00FF00)))), Result)
Result
&color(hsv2rgb(devalue(0.5, hsv(hex(00FF00)))), Result)
Result
&color(hsv2rgb(devalue(0.75, hsv(hex(00FF00)))), Result)
Result
&color(hsv2rgb(devalue(1, hsv(hex(00FF00)))), Result)
Result
so cool
.function add saturation execute(
store(x, rarray(${2})),
array(
index(storage(x), 0),
${1},
index(storage(x), 2)
)
)
Added Function: saturation()
&color(hsv2rgb(saturation(1, hsv(hex(001100)))), Result)
Result
i guess the value needs to be 1 too for that to work
.function add value execute(
store(x, rarray(${2})),
array(
index(storage(x), 0),
index(storage(x), `),
${1}
)
)
Added Function: value()
&color(hsv2rgb(value(1, saturation(1, hsv(hex(001100))))), Result)
java.lang.NumberFormatException: For input string: "`"
in function:
index()
.function add value execute(
store(x, rarray(${2})),
array(
index(storage(x), 0),
index(storage(x), 1),
${1}
)
)
Added Function: value()
&color(hsv2rgb(value(1, saturation(1, hsv(hex(001100))))), Result)
Result
&color(hsv2rgb(value(1, saturation(0.5, hsv(hex(001100))))), Result)
Result
so we can now take a color and make it vibrant
.function add vibrant execute(
store(x, rarray(${2})),
array(
index(storage(x), 0),
1,
1
)
)
Added Function: vibrant()
&color(hsv2rgb(vibrant(hsv(hex(001100)))), Result)
Not enough supplied arguments in the function:
vibrant()
.function add vibrant execute(
store(x, rarray(${1})),
array(
index(storage(x), 0),
1,
1
)
)
Added Function: vibrant()
&color(hsv2rgb(vibrant(hsv(hex(001100)))), Result)
Result
&color(hsv2rgb(vibrant(hsv(hex(001155)))), Result)
Result
&color(hsv2rgb(vibrant(hsv(hex(004455)))), Result)
Result
&color(hsv2rgb(vibrant(hsv(hex(7700FF)))), Result)
Result
&color(hsv2rgb(hsv(hex(001155))), Result)
Result
&color(hsv2rgb(hsv(hex(7700FF))), Result)
Result
i guess the indigo is already vibrant
&color(hsv2rgb(vibrant(hsv(hex(123456)))), Result)
Result
.function add grayscale execute(
store(
L,
round(add(
mul(0.299, and(${1}, hex(FF))),
mul(0.587, and(rshift(${1}, 8), hex(FF))),
mul(0.114, and(rshift(${1}, 16), hex(FF)))
))
),
or(lshift(storage(L), 16), or(lshift(storage(L), 8), storage(L)))
)
Added Function: grayscale()
,color(grayscale(hex(FF0000)), Grayscale!)
&color(grayscale(hex(FF0000)), Grayscale!)
Grayscale!
&color(grayscale(hex(00FFFF)), Grayscale!)
Grayscale!
&color(grayscale(hex(00FF00)), Grayscale!)
Grayscale!
amazing
.function show rgb
color(hsv2rgb(array(random(360), 1, 1)), ${1})
Owner: @night bane
.function add mycolor color(hsv2rgb(array(random(360, userid(${1})), 1, 1)), ${1})
Added Function: mycolor()
&mycolor(@night bane)
@night bane
color based on your user id ๐
&mycolor(@bright dock)
@bright dock
That's cool!
.function add mycolor color(hsv2rgb(array(random(360, context(author)), 1, 1)), ${1})
Added Function: mycolor()
.function add mycolor color(hsv2rgb(array(random(360, context(author)), 1, 1)), concat(<@, context(author), >))
Added Function: mycolor()
&mycolor()
@night bane
&consume(attach(pixels(image(https://cdn.discordapp.com/attachments/443311057042407435/1087456513657942130/2qbeSYtg.jpg), ->random(hex(FFFFFF)))))
Image manipulation!
Original image
&consume(attach(pixels(image(https://cdn.discordapp.com/attachments/443311057042407435/1087456513657942130/2qbeSYtg.jpg), ->grayscale(${P}))))
Uh oh
.curse the twilight
oh its offline
OH
IT WORKED
it took forever
&consume(attach(pixels(image(https://cdn.discordapp.com/attachments/443311057042407435/1087456513657942130/2qbeSYtg.jpg), ->vibrant(${P}))))
Value must be encased in [ ]
๐ฎ
It's very slow lol
&consume(attach(pixels(image(https://cdn.discordapp.com/attachments/443311057042407435/1087456513657942130/2qbeSYtg.jpg), ->vibrant(hsv(${P})))))
java.lang.NumberFormatException: For input string: "[63.33333333333332, 1, 1]"
in function:
pixels()
Iโm trying to not brainstorm a shader-based solution and thatโs brutal
Oh I know
&consume(attach(pixels(image(https://cdn.discordapp.com/attachments/443311057042407435/1087456513657942130/2qbeSYtg.jpg), ->hsv2rgb(vibrant(hsv(${P}))))))
Ok bots dead until that's done
I should be executing these on a new thread
I ended up restarting the bot
lol
converting to hsv on each pixel was a bad idea
lets try a smaller image
&consume(attach(pixels(image(https://cdn.discordapp.com/attachments/443311057042407435/1087508695551844462/voidic_crystal.png), ->hsv2rgb(vibrant(hsv(${P}))))))
Evaluating...
&test
test
cool
new threads ๐
trying this instead
&consume(attach(pixels(image(https://cdn.discordapp.com/attachments/1085771740216573962/1087512003133845534/464207280112533504.png), ->grayscale(${P}))))
execute(
store(
L,
round(add(
mul(0.299, and(${1}, hex(FF))),
mul(0.587, and(rshift(${1}, 8), hex(FF))),
mul(0.114, and(rshift(${1}, 16), hex(FF)))
))
),
or(lshift(storage(L), 16), or(lshift(storage(L), 8), storage(L)))
)
Owner: @night bane
.function add grayscale execute(
store(
L,
round(add(
mul(0.299, and(${1}, hex(FF))),
mul(0.587, and(rshift(${1}, 8), hex(FF))),
mul(0.114, and(rshift(${1}, 16), hex(FF)))
))
),
or(and(${1}, hex(FF000000)), or(lshift(storage(L), 16), or(lshift(storage(L), 8), storage(L))))
)
Added Function: grayscale()
&consume(attach(pixels(image(https://cdn.discordapp.com/attachments/1085771740216573962/1087512003133845534/464207280112533504.png), ->grayscale(${P}))))
Evaluating...
java.lang.NumberFormatException: For input string: "2319400767"
in function:
pixels()
&tohex(grayscale(hex(AABBCCDD)))
AACFCFCF
&grayscale(hex(AABBCCDD))
2865745871
&consume(attach(pixels(image(https://cdn.discordapp.com/attachments/1085771740216573962/1087512003133845534/464207280112533504.png), ->grayscale(${P}))))
nice
&consume(attach(pixels(image(https://cdn.discordapp.com/attachments/1085771740216573962/1087512003133845534/464207280112533504.png), ->hsv2rgb(vibrant(hsv(${P}))))))
hsv conversion really slogs it down
what
my hsv function cant handle alpha
&consume(
attach(
pixels(
image(https://cdn.discordapp.com/attachments/1085771740216573962/1087512003133845534/464207280112533504.png),
->or(and(${P}, hex(FF000000)), hsv2rgb(vibrant(hsv(${P}))))
)
)
)
oh god
&consume(
attach(
pixels(
image(https://cdn.discordapp.com/attachments/1085771740216573962/1087512003133845534/464207280112533504.png),
->or(and(${P}, hex(FF000000)), random(hex(FFFFFF)))
)
)
)

&consume(
attach(
pixels(
image(https://cdn.discordapp.com/attachments/1085771740216573962/1087512003133845534/464207280112533504.png),
->or(and(${P}, hex(FF000000)), random(hex(FFFFFF), ${P}))
)
)
)
lol
&consume(
attach(
pixels(
image(https://cdn.discordapp.com/attachments/1085771740216573962/1087512003133845534/464207280112533504.png),
->or(and(${P}, hex(FF000000)), random(hex(FFFFFF), add(mul(and(${X}, -4), 25117), mul(and(${Y}, -4), 151121))))
)
)
)
Evaluating...
java.lang.NumberFormatException: For input string: "0.0"
in function:
random()
&consume(
attach(
pixels(
image(https://cdn.discordapp.com/attachments/1085771740216573962/1087512003133845534/464207280112533504.png),
->or(and(${P}, hex(FF000000)), random(hex(FFFFFF), long(add(mul(and(${X}, -4), 25117), mul(and(${Y}, -4), 151121)))))
)
)
)
&consume(
attach(
pixels(
image(https://cdn.discordapp.com/attachments/1085771740216573962/1087512003133845534/464207280112533504.png),
->or(and(${P}, hex(FF000000)), random(hex(FFFFFF), long(add(add(mul(and(${X}, -4), 25117), mul(and(${Y}, -4), 151121)), ${P}))))
)
)
)
&consume(
attach(
pixels(
image(https://cdn.discordapp.com/attachments/1085771740216573962/1087512003133845534/464207280112533504.png),
->or(and(${P}, hex(FF000000)), clamp(add(${X}, ${Y}), 0, hex(FFFFFF)))
)
)
)
Evaluating...
java.lang.NumberFormatException: For input string: "0.0"
in function:
or()
&consume(
attach(
pixels(
image(https://cdn.discordapp.com/attachments/1085771740216573962/1087512003133845534/464207280112533504.png),
->or(and(${P}, hex(FF000000)), long(clamp(add(${X}, ${Y}), 0, hex(FFFFFF))))
)
)
)
gradient hydra
&consume(
attach(
pixels(
image(https://cdn.discordapp.com/attachments/1085771740216573962/1087512003133845534/464207280112533504.png),
->or(and(${P}, hex(FF000000)), long(clamp(mul(add(${X}, ${Y}), 2), 0, hex(FFFFFF))))
)
)
)
&consume(
attach(
pixels(
image(https://cdn.discordapp.com/attachments/1085771740216573962/1087512003133845534/464207280112533504.png),
->or(and(${P}, hex(FF000000)), long(clamp(add(lshift(${X}, 8), ${Y}), 0, hex(FFFFFF))))
)
)
)
&consume(
attach(
pixels(
image(https://cdn.discordapp.com/attachments/1085771740216573962/1087512003133845534/464207280112533504.png),
->or(and(${P}, hex(FFFF0000)), long(clamp(add(lshift(${X}, 8), ${Y}), 0, hex(FFFFFF))))
)
)
)
&consume(
attach(
pixels(
image(https://cdn.discordapp.com/attachments/1085771740216573962/1087512003133845534/464207280112533504.png),
->and(${P}, FF00FFFF)
)
)
)
Evaluating...
java.lang.NumberFormatException: For input string: "FF00FFFF"
in function:
and()
&consume(
attach(
pixels(
image(https://cdn.discordapp.com/attachments/1085771740216573962/1087512003133845534/464207280112533504.png),
->and(${P}, hex(FF00FFFF))
)
)
)
&mycolor()
@night bane
ok cool
I made a massive internal change
for performance
the performance part isnt applied to the hot functions (loop, pixels, if)
working on that now
but basically the eval will take the strings and turn them into actual nested objects that hold the Function + Function/Object params or Object value
then runs that last
so it parses the entire string into the big ol nested function object instead of parsing each string on the fly
this is great for loops
so instead of reparsing the string each iteration, i can just use the existing nested function object
Ooo, that is a great optimization
index(array(${1}, ${2}), 1)
Owner: @night bane
,eval latestTwilightForest()
[]
,eval execute(store(asdf, test), storage(asdf))
[test, test]
welllll thats a problem
,eval execute(store(a, b), execute(store(asdf, test), concat(storage(asdf), storage(a))))
[b, [[test, testb], 1]]
b
ok i fixed it somehow during a refactor
makes no sense but i'll take it
,eval execute(store(a, b), concat(storage(a), c))
bc
,eval execute(store(d, e), execute(store(a, b), concat(storage(a), c, storage(d))))
bce
ok its baby induction time, i'll come back to this ๐
I can't even remote desktop into my PC to finish the code :(
I forgot to turn it on before I left
oh shit
keep us posted
.function add isEven boolean(and(not(${1}), 1))
Added Function: isEven()
&isEven(0)
boolean(and(not(0), 1))
Added Function: isEven()
&isEven(0)
false
Added Function: isEven()
&isEven(0)
true
&isEven(1)
false
&long(isEven(0))
Evaluating...
java.lang.NumberFormatException: For input string: "true"
in function:
long()
&functions()
Convert to a Long
Convert to a Double
Convert to a Double
Convert a Boolean to a Long
Convert a Long to a Boolean
&btl(isEven(0))
1
.function add isEven ltb(and(not(${1}), 1))
Added Function: isEven()
&btl(isEven(0))
1
&btl(isEven(1))
0
&consume(
attach(
pixels(
image(https://cdn.discordapp.com/attachments/1085771740216573962/1087512003133845534/464207280112533504.png),
->or(and(${P}, hex(FF000000)), btl(isEven(${P})))
)
)
)
Oh yeah 1 isn't white
&consume(
attach(
pixels(
image(https://cdn.discordapp.com/attachments/1085771740216573962/1087512003133845534/464207280112533504.png),
->or(and(${P}, hex(FF000000)), mul(hex(FFFFFF), btl(isEven(${P}))))
)
)
)
Evaluating...
java.lang.NumberFormatException: For input string: "1.6777215E7"
in function:
or()
&consume(
attach(
pixels(
image(https://cdn.discordapp.com/attachments/1085771740216573962/1087512003133845534/464207280112533504.png),
->or(and(${P}, hex(FF000000)), long(mul(hex(FFFFFF), btl(isEven(${P})))))
)
)
)
.function add ubyte byte(if(less(127, ${1}), ->sub(${1}, 256), ->${1}))
Added Function: ubyte()
&ubyte(255)
Evaluating...
java.lang.NumberFormatException: For input string: "-1.0"
in function:
byte()
.function add ubyte byte(long(if(less(127, ${1}), ->sub(${1}, 256), ->${1})))
Added Function: ubyte()
&ubyte(255)
-1
&ubyte(128)
-128
&ubyte(127)
127
Er wait
That's the opposite of unsigned
Which is what I want yes, I just named the function wrong
.function add sbyte byte(long(if(less(127, ${1}), ->sub(${1}, 256), ->${1})))
Added Function: sbyte()
.function remove ubyte
Function ubyte() removed!
&sbyte(257)
1
Evaluating...
java.lang.NumberFormatException: Value out of range. Value:"256" Radix:10
in function:
byte()
ok performance patch done
&consume(
attach(
pixels(
image(https://cdn.discordapp.com/attachments/1085771740216573962/1087512003133845534/464207280112533504.png),
->or(and(${P}, hex(FF000000)), hsv2rgb(vibrant(hsv(${P}))))
)
)
)
lets see how long this takes
last time it took 9 mins
seems to be taking just as long if not longer
ok just as long
very interesting
even without the string parsing its still pretty expensive
@main warren
i added sin cos and tan functions
i'll probably add the arc variants too, including atan2, also secants
im too lazy right now though
deg <-> rad is really simple to implement yourself so i wont bother with that
same with a PI constant
technically you can implement the (co)sine and tangent stuff yourself too with a manual table
.function add pi 3.1415926535897932
Added Function: pi()
&pi()
3.1415926535897932
.function add pi double(3.1415926535897932)
Added Function: pi()
&pi()
3.141592653589793
.function add pi double(3.141592653589793)
Added Function: pi()
.function add rad mul(${1}, div(pi(), 180))
Added Function: rad()
&rad(1)
0.017453292519943295
.function add deg mul(${1}, div(180, pi()))
Added Function: deg()
°(0.017453292519943295)
1.0
&rad(360)
6.283185307179586
&rad(180)
3.141592653589793
&sin(rad(0))
0.0
&sin(rad(90))
1.0
&sin(rad(180))
1.2246467991473532E-16
&sin(rad(360))
-2.4492935982947064E-16
&double(2.2204460492503130808472633361816E-16)
2.220446049250313E-16
.function add epsilon double(2.220446049250313E-16)
Added Function: epsilon()
&execute(store(result, sin(rad(180))), if(less(storage(result), epsilon()), 0, storage(result)))
0
&abs(-1)
1.0
.function add precise execute(
store(result, ${1}),
if(
less(abs(storage(result)), epsilon()),
0,
storage(result)
)
)
Added Function: precise()
&precise(sin(rad(180)))
0
&precise(sin(rad(181)))
-0.017452406437283637
&precise(sin(rad(360)))
-2.4492935982947064E-16
&precise(sin(rad(0)))
0
blah
,eval consume(
attach(
aimage(cimage(100, 100))
)
)
Evaluating...
,eval consume(
attach(
aimage(cimage(100, 100))
)
)
,eval consume(
attach(
execute(
store(img, cimage(100, 100))
execute(
iloop(
100,
->execute(
store(X, ${R}),
iloop(
100,
->execute(
store(Y, ${R}),
pixel(
storage(img),
storage(X),
storage(Y),
and(hex(FF0000FF), and(lshift(long(storage(X)), 16), lshift(long(storage(Y)), 8)))
)
)
)
)
)
)
)
aimage(cimage(100, 100))
)
)
Evaluating...
,eval consume(
attach(
execute(
store(img, cimage(100, 100))
execute(
iloop(
100,
->execute(
store(X, ${I}),
iloop(
100,
->execute(
store(Y, ${I}),
pixel(
storage(img),
storage(X),
storage(Y),
and(hex(FF0000FF), and(lshift(long(storage(X)), 16), lshift(long(storage(Y)), 8)))
)
)
)
)
)
)
)
aimage(cimage(100, 100))
)
)
Evaluating...
,eval consume(
execute(
execute(
store(img, cimage(100, 100)),
iloop(
100,
->execute(
store(X, ${I}),
iloop(
100,
->execute(
store(Y, ${I}),
pixel(
storage(img),
storage(X),
storage(Y),
or(hex(FF0000FF), or(lshift(long(storage(X)), 16), lshift(long(storage(Y)), 8)))
)
)
)
)
)
),
attach(aimage(storage(img)))
)
)
