#Bot Spam

1 messages ยท Page 2 of 1

night bane
#

i have no idea how to write math for hsv though

#

let me look at my hsv code in voidscape

#

it doesnt use awt

bright dock
#

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)

silver sunBOT
#

2.0

bright dock
#

wait....

#

.function show lerpClamped

silver sunBOT
#
__**Function Source**__
lerpClamped
clamp(lerp(${1}, ${2}, ${3}), ${2}, ${3})

Owner: @bright dock

night bane
#

oh it just gets the l

#

int L = (int) (0.299D * ((pixel) & 0xFF) + 0.587D * ((pixel >> 8) & 0xFF) + 0.114D * ((pixel >> 16) & 0xFF))

bright dock
#

.function show clampedLerp

silver sunBOT
#
__**Function Source**__
clampedLerp
if(
  less(${1},0),
  ${2},
  if(
    less(1,${1}),
    ${3},
    lerp(${1}, ${2}, ${3})
  )
)

Owner: @bright dock

bright dock
#

Dammit, me

#

.function remove lerpClamped

silver sunBOT
#

Function lerpClamped() removed!

bright dock
#

&clampedLerp(1,1,0)

silver sunBOT
#

0.0

bright dock
#

&clampedLerp(0,1,0)

silver sunBOT
#

1.0

bright dock
#

&clampedLerp(0.25,10,0)

silver sunBOT
#

7.5

night bane
#

yeah my code just turns a color into grayscale

#

by doing rgb = (L, L, L)

bright dock
#

Oooh, yeah those are eye-accurate weights (I think)

night bane
#

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))), ...)

bright dock
#

That looks actually reasonable, I was freaking out a little over reading Java swing's ColorModelHSV.HSVtoRGB switch

night bane
#

its store not storage, storage is the getter

#

i could probably whip this up

#

fun little project woo

bright dock
#

Let's goooo

night bane
#

60 degrees just means this is in fact in degrees yes?

#

so just 60 * ...

#

&mod()

silver sunBOT
#

mod()

bright dock
#

yes

night bane
#

oof

#

no mod function

bright dock
#

The color sqerp solution is better utilized if you have a gradient map involved, honestly

night bane
#

going to be using this

#

as % in java is the remainder operator

#

not modulo

#

&mod(4, 3)

silver sunBOT
#

0

night bane
#

uh souldnt that be 1

#

&mod(3, 4)

silver sunBOT
#

0

night bane
#

oh i see what i did

#

it was doing mod(x, x)

#

instead of mod(x, y)

#

&mod(5, 2)

silver sunBOT
#

1

night bane
#

&mod(5, 3)

silver sunBOT
#

2

night bane
#

perfect

#

&mod(5, 1)

silver sunBOT
#

0

night bane
#

that looks weird though

#

shouldnt 5 % 1 be 4 or am i crazy

#

&mod(1, 5)

silver sunBOT
#

1

night bane
#

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

night bane
#

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))

silver sunBOT
#

hi

night bane
#

.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))
)
)
)
)
)
)
)
)

silver sunBOT
#

Added Function: hsv()

bright dock
night bane
#

this is a chonker

bright dock
#

wheeled the bad boy in

night bane
#

&hsv(hex(#AABBCC))

silver sunBOT
#

java.lang.NumberFormatException: For input string: "#AABBCC" under radix 16

in function:
hex()

night bane
#

lol

bright dock
#

&hsv(hex(7F7F00))

silver sunBOT
#

java.lang.NullPointerException: Cannot invoke "Object.toString()" because "l" is null

in function:
sub()

night bane
#

ugh

bright dock
#

&color(hex(7F7F00))

silver sunBOT
#

Not enough supplied arguments in the function:
color()

bright dock
#

&color(hex(7F7F00),hi9)

silver sunBOT
#

hi9

night bane
#

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))
)
)
)
)
)
)
)
)

silver sunBOT
#

Added Function: hsv()

night bane
#

&hsv(hex(AABBCC))

silver sunBOT
#

java.lang.NumberFormatException: For input string: "-0.5"

in function:
mod()

night bane
#

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))
)
)
)
)
)
)
)
)

silver sunBOT
#

Added Function: hsv()

night bane
#

&hsv(hex(AABBCC))

silver sunBOT
#

[210.0, 0.16666666666666666, 204.0]

night bane
#

ok now does that look right

bright dock
#

&exRed(hex(AABBCC))

silver sunBOT
#

170

night bane
#

close!

#

the V is wrong ๐Ÿ˜„

bright dock
#

Oooh, you're checking HSV values not RGB

night bane
#

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))

silver sunBOT
#

0

night bane
#

&and(rshift(hex(AA0000), 16), hex(FF))

silver sunBOT
#

170

night bane
#

OH

#

IM SUPPOSED TO DIVIDE BY 255

#

R' = R/255

G' = G/255

B' = B/255

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(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))
)
)
)
)
)
)
)
)

silver sunBOT
#

Added Function: hsv()

night bane
#

&hsv(hex(AABBCC))

silver sunBOT
#

[210.00000000000003, 0.16666666666666677, 0.8]

night bane
#

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

#

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))
)
)
)
)
)
)
)
)

silver sunBOT
#

Added Function: hsv()

night bane
bright dock
#

that's a good mathematical model of the javax swing impl

night bane
#

,eval rarray([a, b, c])

silver sunBOT
#

[Ljava.lang.String;@53742f12

night bane
#

fun

#

,eval rarray([a, b, c])

silver sunBOT
#

[a, b, c]

night bane
#

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])

silver sunBOT
#

[a, b, c]

night bane
#

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))

silver sunBOT
#

Added Function: abs()

night bane
#

&abs(-5)

silver sunBOT
#

5.0

night bane
#

very cool

night bane
#

.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))
)
)
)
)
)
)
)
)
)
)

silver sunBOT
#

Added Function: hsv2rgb()

night bane
#

lol

#

its huge

#

&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])

silver sunBOT
#

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')

night bane
#

hmm

#

im not sure whats getting converted to a string

#

.function add test execute(
store(x, rarray(${1})),
index(storage(x), 0)
)

silver sunBOT
#

Added Function: test()

night bane
#

&test([a, b])

silver sunBOT
#

a

night bane
#

.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
)
)
)
)
)
)
)
)

silver sunBOT
#

Added Function: hsv2rgb()

night bane
#

&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])

silver sunBOT
#

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')

night bane
#

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))
)
)
)
)
)
)
)
)
)

silver sunBOT
#

Added Function: hsv2rgb()

night bane
#

&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])

silver sunBOT
#

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')

night bane
#

&test([210.00000000000003, 0.16666666666666677, 0.8])

silver sunBOT
#

210.00000000000003

night bane
#

.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
)
)
)
)
)
)
)
)

silver sunBOT
#

Added Function: hsv2rgb()

night bane
#

&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])

silver sunBOT
#

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')

night bane
#

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))
)
)
)
)
)
)
)
)
)
)

silver sunBOT
#

Added Function: hsv2rgb()

night bane
#

&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])

silver sunBOT
#

Index out of bounds: 1

night bane
#

WHAT

#

.function show test

silver sunBOT
#
__**Function Source**__
test
execute(
    store(x, rarray(${1})),
    index(storage(x), 0)
)

Owner: @night bane

night bane
#

.function add test execute(
store(x, rarray(${1})),
index(storage(x), 1)
)

silver sunBOT
#

Added Function: test()

night bane
#

&test([210.00000000000003, 0.16666666666666677, 0.8])

silver sunBOT
#

Index out of bounds: 1

night bane
#

wow

#

.function show execute

silver sunBOT
#
__**Function Source**__
execute
index(array(->${1}, ->${2}), 1)

Owner: @night bane

night bane
#

ok apparently the pipeline is striping out the escape character

#

whatever

#

easy fix

#

&test([210.00000000000003, 0.16666666666666677, 0.8])

silver sunBOT
#

0.16666666666666677

night bane
#

&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])

silver sunBOT
#

java.lang.NumberFormatException: For input string: "3.5000000000000004"

in function:
mod()

night bane
#

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))
)
)
)
)
)
)
)
)
)
)

silver sunBOT
#

Added Function: hsv2rgb()

night bane
#

&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])

silver sunBOT
#

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')

night bane
#

.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
)
)
)
)
)
)
)
)

silver sunBOT
#

Added Function: hsv2rgb()

night bane
#

&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])

silver sunBOT
#

test

night bane
#

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))
)
)
)
)
)
)
)
)
)
)

silver sunBOT
#

Added Function: hsv2rgb()

night bane
#

&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])

silver sunBOT
#

java.lang.NumberFormatException: For input string: "204.0"

in function:
and()

night bane
#

.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)))
)
)
)
)
)
)
)
)
)
)

silver sunBOT
#

Added Function: hsv2rgb()

night bane
#

&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])

silver sunBOT
#

136

night bane
#

theres no way thats right

#

&hex(AABBCC)

silver sunBOT
#

11189196

night bane
#

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)))
)
)
)
)
)
)
)
)
)
)

silver sunBOT
#

Added Function: hsv2rgb()

night bane
#

&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])

silver sunBOT
#

0

night bane
#

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)))
)
)
)
)
)
)
)
)
)
)

silver sunBOT
#

Added Function: hsv2rgb()

night bane
#

&hsv2rgb([210.00000000000003, 0.16666666666666677, 0.8])

silver sunBOT
#

11193548

night bane
#

&hex(AABBCC)

silver sunBOT
#

11189196

night bane
#

pretty damn close

#

but i think its good enough!

#

&concat(exRed(11193548), exGreen(11193548), exBlue(11193548))

silver sunBOT
#

170204204

night bane
#

er

#

whatever i'll make a int to hex string function later

#

i need to afk

night bane
#

&tohex(11193548)

silver sunBOT
#

aacccc

night bane
#

&tohex(11193548)

silver sunBOT
#

AACCCC

night bane
#

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)))

silver sunBOT
#

java.lang.NumberFormatException: For input string: "AABBCC"

in function:
rshift()

night bane
#

&tohex(hsv2rgb(hsv(hex(AABBCC))))

silver sunBOT
#

AACCCC

night bane
#

&tohex(hsv2rgb(hsv(hex(FFFFFF))))

silver sunBOT
#

FFFFFF

night bane
#

&tohex(hsv2rgb(hsv(hex(000000))))

silver sunBOT
#

0

night bane
#

&tohex(hsv2rgb(hsv(hex(123456))))

silver sunBOT
#

115656

night bane
#

&color(tohex(hsv2rgb(hsv(hex(FFFFFF)))), hi)

silver sunBOT
#

java.lang.NumberFormatException: For input string: "FFFFFF"

in function:
color()

night bane
#

&color(hsv2rgb(hsv(hex(FFFFFF))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(hsv(hex(123456))), hi)

silver sunBOT
#

hi

night bane
#

&color(hex(123456))

silver sunBOT
#

Not enough supplied arguments in the function:
color()

night bane
#

&color(hex(123456), hi)

silver sunBOT
#

hi

night bane
#

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)))
)
)
)
)
)
)
)
)
)
)

silver sunBOT
#

Added Function: hsv2rgb()

night bane
#

&color(hex(123456), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(hsv(hex(123456))), hi)

silver sunBOT
#

hi

night bane
#

&hsv2rgb(hsv(hex(123456))

silver sunBOT
#

Not enough arguments!

night bane
#

&hsv2rgb(hsv(hex(123456)))

silver sunBOT
#

1201750

night bane
#

&hsv(hex(123456))

silver sunBOT
#

[210.0, 0.7906976744186047, 0.33725490196078434]

night bane
#

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)))
)
)
)
)
)
)
)
)
)
)

silver sunBOT
#

Added Function: hsv2rgb()

night bane
#

&tohex(hsv2rgb(hsv(hex(123456))))

silver sunBOT
#

121256

night bane
#

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)))
)
)
)
)
)
)
)
)
)
)

silver sunBOT
#

Added Function: hsv2rgb()

night bane
#

&tohex(hsv2rgb(hsv(hex(123456))))

silver sunBOT
#

123456

night bane
#

HAHA

#

ITS PERFECT

#

&tohex(hsv2rgb(hsv(hex(918273))))

silver sunBOT
#

917373

night bane
#

wellll

#

thats close

#

&color(hsv2rgb(hsv(hex(918273))), hi)

silver sunBOT
#

hi

night bane
#

&color(hex(918273), hi)

silver sunBOT
#

hi

night bane
#

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

night bane
#

.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)),
)
)
)

silver sunBOT
#

Added Function: lerphsv()

night bane
#

&hsv(hex(FF0000))

silver sunBOT
#

[0.0, 1.0, 1.0]

night bane
#

&hsv(hex(00FF00))

silver sunBOT
#

[180.0, 1.0, 1.0]

night bane
#

&lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))

silver sunBOT
#

Value must be encased in [ ]

night bane
#

.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)),
)
)
)

silver sunBOT
#

Added Function: lerphsv()

night bane
#

&lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))

silver sunBOT
#

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')

night bane
#

.function add rarray(${2})

silver sunBOT
#
Error running command!

Missing Argument(s): func

night bane
#

.function add lerphsv rarray(${2})

silver sunBOT
#

Added Function: lerphsv()

night bane
#

&lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))

silver sunBOT
#

[0.0, 1.0, 1.0]

night bane
#

.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)),
)
)
)

silver sunBOT
#

Added Function: lerphsv()

night bane
#

&lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))

silver sunBOT
#

Value must be encased in [ ]

night bane
#

so confused

#

&lerphsv(0.5, rarray(hsv(hex(FF0000))), rarray(hsv(hex(00FF00))))

silver sunBOT
#

Value must be encased in [ ]

night bane
#

&lerphsv(0.5, string(hsv(hex(FF0000))), string(hsv(hex(00FF00))))

silver sunBOT
#

Value must be encased in [ ]

night bane
#

&(hsv(hex(FF0000))

silver sunBOT
#

(hsv(hex(FF0000))

night bane
#

&hsv(hex(FF0000))

silver sunBOT
#

[0.0, 1.0, 1.0]

night bane
#

&lerphsv(0.5, [0.0, 1.0, 1.0], [0.0, 1.0, 1.0])

silver sunBOT
#

Value must be encased in [ ]

night bane
#

&lerphsv(0.5, [0.0, 1.0, 1.0], [180.0, 1.0, 1.0])

silver sunBOT
#

Value must be encased in [ ]

night bane
#

.function add lerphsv execute(
store(x, rarray(${2}))
execute(
store(y, rarray(${3})),
test
)
)

silver sunBOT
#

Added Function: lerphsv()

night bane
#

&lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))

silver sunBOT
#

Value must be encased in [ ]

night bane
#

.function add lerphsv execute(
store(x, ${2})
execute(
store(y, ${3}),
storage(x)
)
)

silver sunBOT
#

Added Function: lerphsv()

night bane
#

&lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))

silver sunBOT
#

Not enough supplied arguments in the function:
execute()

night bane
#

.function add lerphsv execute(
store(x, ${2}),
execute(
store(y, ${3}),
storage(x)
)
)

silver sunBOT
#

Added Function: lerphsv()

night bane
#

&lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))

silver sunBOT
#

[0.0, 1.0, 1.0]

night bane
#

.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)),
)
)
)

silver sunBOT
#

Added Function: lerphsv()

night bane
#

&lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))

silver sunBOT
#

Index out of bounds: 3

night bane
#

.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)),
)
)
)

silver sunBOT
#

Added Function: lerphsv()

night bane
#

&lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))

silver sunBOT
#

[90.0, 1.0, 1.0]

night bane
#

cool!

#

&tohex(hsv2rgb(lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))))

silver sunBOT
#

80FF00

night bane
#

&color(hsv2rgb(lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(0.75, hsv(hex(FF0000)), hsv(hex(00FF00)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(0.25, hsv(hex(FF0000)), hsv(hex(00FF00)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(0, hsv(hex(FF0000)), hsv(hex(00FF00)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(1, hsv(hex(FF0000)), hsv(hex(00FF00)))), hi)

silver sunBOT
#

hi

night bane
#

wh

#

&hsv(hex(00FF00))

silver sunBOT
#

[180.0, 1.0, 1.0]

night bane
#

&tohex(hsv2rgb(hsv(hex(00FF00))))

silver sunBOT
#

FFFF

night bane
#

&color(hsv2rgb(hsv(hex(00FF00))), hi)

silver sunBOT
#

hi

night bane
#

&hsv(hex(00FF00))

silver sunBOT
#

[180.0, 1.0, 1.0]

night bane
#

should be 120h

#

.function show hsv

silver sunBOT
#
Error running command!

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)

night bane
#

lol

#

.function list

silver sunBOT
#
Error running command!

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)

night bane
#

jeez

#

.function list

silver sunBOT
#
__**Functions**__
hsv

Code is too large, use the show command instead!

Owner: @night bane

night bane
#

.function show hsv

silver sunBOT
#
__**Function Source**__
hsv

Output was larger than 2048 characters

Owner: @night bane

night bane
#

.function show hsv

silver sunBOT
#
__**Function Source**__
hsv

Output was larger than 2048 characters

Owner: @night bane

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))
)
)
)
)
)
)
)
)

silver sunBOT
#

Added Function: hsv()

night bane
#

&hsv(hex(00FF00))

silver sunBOT
#

[120.0, 1.0, 1.0]

night bane
#

fixed

#

&color(hsv2rgb(lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(00FF00)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(1, hsv(hex(FF0000)), hsv(hex(00FF00)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(0, hsv(hex(FF0000)), hsv(hex(00FF00)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(0.75, hsv(hex(FF0000)), hsv(hex(00FF00)))), hi)

silver sunBOT
#

hi

night bane
#

its so good

#

&color(hsv2rgb(lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(0000FF)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(0.75, hsv(hex(FF0000)), hsv(hex(0000FF)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(0.25, hsv(hex(FF0000)), hsv(hex(0000FF)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(0.5, hsv(hex(FF0000)), hsv(hex(FF00FF)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(0, hsv(hex(FF0000)), hsv(hex(FF00FF)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(1, hsv(hex(FF0000)), hsv(hex(FF00FF)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(2, hsv(hex(FF0000)), hsv(hex(FF00FF)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(-0.5, hsv(hex(FF0000)), hsv(hex(FF00FF)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(-1, hsv(hex(FF0000)), hsv(hex(FF00FF)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(-2, hsv(hex(FF0000)), hsv(hex(FF00FF)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(-3, hsv(hex(FF0000)), hsv(hex(FF00FF)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(-4, hsv(hex(FF0000)), hsv(hex(FF00FF)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(-5, hsv(hex(FF0000)), hsv(hex(FF00FF)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(0, hsv(hex(00FF00)), hsv(hex(FF0000)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(0.5, hsv(hex(00FF00)), hsv(hex(FF0000)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(0.75, hsv(hex(00FF00)), hsv(hex(FF0000)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(1, hsv(hex(00FF00)), hsv(hex(FF0000)))), hi)

silver sunBOT
#

hi

night bane
#

.function show downloads

silver sunBOT
#
__**Function Source**__
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

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)

silver sunBOT
#

Added Function: downloads()

night bane
#

&downloads(asdf)

silver sunBOT
#

asdfghjkl๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ

0 Downloads

night bane
#

&downloads(melon golem)

silver sunBOT
#

Melon Golem

134K Downloads

night bane
#

&downloads(the twilight)

silver sunBOT
#

The Twilight Forest

86M Downloads

night bane
#

&downloads(jei)

silver sunBOT
#

Just Enough Items (JEI)

218M Downloads

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)

silver sunBOT
#

Added Function: downloads()

night bane
#

just some formatting

#

.function show downloads

silver sunBOT
#
Error running command!

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)

night bane
#

1024 ???

night bane
#

.function show rgb

silver sunBOT
#
__**Function Source**__
rgb
color(random(hex(FFFFFF)), color!)

Owner: @night bane

night bane
#

&olor(hsv2rgb(array(random(360), 1, 1), color!)

silver sunBOT
#

olor(hsv2rgb(array(random(360), 1, 1), color!)

night bane
#

&color(hsv2rgb(array(random(360), 1, 1), color!)

silver sunBOT
#

java.lang.NumberFormatException: For input string: "hsv2rgb(array(random(360), 1, 1), color!"

in function:
color()

night bane
#

&color(hsv2rgb(array(random(360), 1, 1)), color!)

silver sunBOT
#

color!

night bane
#

&color(hsv2rgb(array(random(360), 1, 1)), color!)

silver sunBOT
#

color!

night bane
#

.function add rgb color(hsv2rgb(array(random(360), 1, 1)), color!)

silver sunBOT
#

Added Function: rgb()

night bane
#

&rgb()

silver sunBOT
#

color!

night bane
#

&rgb()

silver sunBOT
#

color!

night bane
#

&rgb()

silver sunBOT
#

color!

night bane
#

&rgb()

silver sunBOT
#

color!

night bane
#

&rgb()

silver sunBOT
#

color!

night bane
#

&rgb()

silver sunBOT
#

color!

night bane
#

very cool

#

.function add rgb color(hsv2rgb(array(random(360), 1, 1)), ${1})

silver sunBOT
#

Added Function: rgb()

bright dock
#

This is cracked

night bane
#

&rgb(Fabulous!)

silver sunBOT
#

Fabulous!

bright dock
#

Hell yeah!

night bane
#

i love hsv

bright dock
#

Me too, this especially looks like victory kirbodance

night bane
#

did you see the hsv lerp i made

bright dock
#

&rgb A random color!

silver sunBOT
#

rgb A random color!

night bane
#

.function show hsvlerp

silver sunBOT
#
Error running command!

Function doesn't exist!

night bane
#

er

bright dock
#

&rgb(A random color!)

silver sunBOT
#

A random color!

night bane
#

i forgot what i called it

#

.function show lerphsv

silver sunBOT
#
__**Function Source**__
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)),
        )
    )
)

Owner: @night bane

night bane
#

takes 2 hsv inputs

bright dock
#

Thatโ€™s cool!

night bane
#

.function show downloads

silver sunBOT
#
__**Function Source**__
downloads

Output was larger than 1024 charactersGets the Download Count of a Project

Owner: @night bane

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))))

silver sunBOT
#

16776960

night bane
#

&color(hsv2rgb(lerphsv(0.5, hsv(hex(00FF00)), hsv(hex(FF0000)))))

silver sunBOT
#

Not enough supplied arguments in the function:
color()

night bane
#

&color(hsv2rgb(lerphsv(0.5, hsv(hex(00FF00)), hsv(hex(FF0000)))), hi)

silver sunBOT
#

hi

bright dock
#

I canโ€™t get over how awesome this is

night bane
#

.function list

silver sunBOT
#
__**Functions**__
downloads

Code is too large, use the show command instead!Gets the Download Count of a Project

Owner: @night bane

night bane
#

missing there too

#

.function show downloads

silver sunBOT
#
__**Function Source**__
downloads

Output was larger than 1024 characters

Gets the Download Count of a Project

Owner: @night bane

night bane
#

there we go

#

&color(hsv2rgb(lerphsv(0.5, hsv(hex(000000)), hsv(hex(FF0000)))), hi)

silver sunBOT
#

hi

night bane
#

hm

#

that should be a dark green no?

#

&color(hsv2rgb(lerphsv(0.75, hsv(hex(000000)), hsv(hex(FF0000)))), hi)

silver sunBOT
#

hi

night bane
#

weird!

#

.function show lerphsv

silver sunBOT
#
__**Function Source**__
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)),
        )
    )
)

Owner: @night bane

night bane
#

&hsv(hex(000000))

silver sunBOT
#

[NaN, NaN, 0.0]

night bane
#

NAN?

#

WHAT

#

no wonder why its broke

#

&hex(000000)

silver sunBOT
#

0

night bane
#

.function show hsv

silver sunBOT
#
__**Function Source**__
hsv

Output was larger than 1024 characters

Owner: @night bane

night bane
#

&div(and(rshift(0, 16), hex(FF)), 255)

silver sunBOT
#

0.0

night bane
#

&equal(sub(0, 0), 0)

silver sunBOT
#

false

night bane
#

huh

#

how is 0 not equal to 0

#

i guess its doing Object.equals

#

&equal(double(storage(d)), 0)

silver sunBOT
#

java.lang.NullPointerException: Cannot invoke "Object.toString()" because the return value of "java.util.List.get(int)" is null

in function:
double()

night bane
#

er

#

&equal(double(sub(0, 0)), 0)

silver sunBOT
#

false

night bane
#

&equal(sub(0, 0), double(0))

silver sunBOT
#

true

night bane
#

&equal(sub(0, 0), 0.0)

silver sunBOT
#

false

night bane
#

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))
)
)
)
)
)
)
)
)

silver sunBOT
#

Added Function: hsv()

night bane
#

&hsv(hex(000000))

silver sunBOT
#

[0, 0, 0.0]

night bane
#

there we go

#

.function show hsv2rgb

silver sunBOT
#
__**Function Source**__
hsv2rgb

Output was larger than 1024 characters

Owner: @night bane

night bane
#

that one doesnt appear to have the same problem

#

&color(hsv2rgb(lerphsv(0.75, hsv(hex(000000)), hsv(hex(FF0000)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(0.75, hsv(hex(000000)), hsv(hex(00FF00)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(0.5, hsv(hex(000000)), hsv(hex(00FF00)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(0.25, hsv(hex(000000)), hsv(hex(00FF00)))), hi)

silver sunBOT
#

hi

night bane
#

&color(hsv2rgb(lerphsv(0, hsv(hex(000000)), hsv(hex(00FF00)))), hi)

silver sunBOT
#

hi

night bane
#

the value is getting lerped too, thats why it turns brown

#

.function show lerphsv

silver sunBOT
#
__**Function Source**__
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)),
        )
    )
)

Owner: @night bane

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)
)
)

silver sunBOT
#

Added Function: saturate()

night bane
#

&saturate(1, hsv(hex(00FF00)))

silver sunBOT
#

[120.0, 1.0, 1.0]

night bane
#

&color(hsv2rgb(saturate(1, hsv(hex(00FF00)))), Result)

silver sunBOT
#

Result

night bane
#

&color(hsv2rgb(saturate(0.5, hsv(hex(00FF00)))), Result)

silver sunBOT
#

Result

night bane
#

&color(hsv2rgb(saturate(0.25, hsv(hex(00FF00)))), Result)

silver sunBOT
#

Result

night bane
#

&color(hsv2rgb(saturate(0, hsv(hex(00FF00)))), Result)

silver sunBOT
#

Result

night bane
#

wow

#

.function remove saturate

silver sunBOT
#

Function saturate() removed!

night bane
#

.function add desaturate execute(
store(x, rarray(${2})),
array(
index(storage(x), 0),
lerp(${1}, 0, index(storage(x), 1)),
index(storage(x), 2)
)
)

silver sunBOT
#

Added Function: desaturate()

night bane
#

.function add devalue execute(
store(x, rarray(${2})),
array(
index(storage(x), 0),
index(storage(x), 1),
lerp(${1}, 0, index(storage(x), 2))
)
)

silver sunBOT
#

Added Function: devalue()

night bane
#

&color(hsv2rgb(devalue(0, hsv(hex(00FF00)))), Result)

silver sunBOT
#

Result

night bane
#

&color(hsv2rgb(devalue(0.25, hsv(hex(00FF00)))), Result)

silver sunBOT
#

Result

night bane
#

&color(hsv2rgb(devalue(0.5, hsv(hex(00FF00)))), Result)

silver sunBOT
#

Result

night bane
#

&color(hsv2rgb(devalue(0.75, hsv(hex(00FF00)))), Result)

silver sunBOT
#

Result

night bane
#

&color(hsv2rgb(devalue(1, hsv(hex(00FF00)))), Result)

silver sunBOT
#

Result

night bane
#

so cool

#

.function add saturation execute(
store(x, rarray(${2})),
array(
index(storage(x), 0),
${1},
index(storage(x), 2)
)
)

silver sunBOT
#

Added Function: saturation()

night bane
#

&color(hsv2rgb(saturation(1, hsv(hex(001100)))), Result)

silver sunBOT
#

Result

night bane
#

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}
)
)

silver sunBOT
#

Added Function: value()

night bane
#

&color(hsv2rgb(value(1, saturation(1, hsv(hex(001100))))), Result)

silver sunBOT
#

java.lang.NumberFormatException: For input string: "`"

in function:
index()

night bane
#

.function add value execute(
store(x, rarray(${2})),
array(
index(storage(x), 0),
index(storage(x), 1),
${1}
)
)

silver sunBOT
#

Added Function: value()

night bane
#

&color(hsv2rgb(value(1, saturation(1, hsv(hex(001100))))), Result)

silver sunBOT
#

Result

night bane
#

&color(hsv2rgb(value(1, saturation(0.5, hsv(hex(001100))))), Result)

silver sunBOT
#

Result

night bane
#

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
)
)

silver sunBOT
#

Added Function: vibrant()

night bane
#

&color(hsv2rgb(vibrant(hsv(hex(001100)))), Result)

silver sunBOT
#

Not enough supplied arguments in the function:
vibrant()

night bane
#

.function add vibrant execute(
store(x, rarray(${1})),
array(
index(storage(x), 0),
1,
1
)
)

silver sunBOT
#

Added Function: vibrant()

night bane
#

&color(hsv2rgb(vibrant(hsv(hex(001100)))), Result)

silver sunBOT
#

Result

night bane
#

&color(hsv2rgb(vibrant(hsv(hex(001155)))), Result)

silver sunBOT
#

Result

night bane
#

&color(hsv2rgb(vibrant(hsv(hex(004455)))), Result)

silver sunBOT
#

Result

night bane
#

&color(hsv2rgb(vibrant(hsv(hex(7700FF)))), Result)

silver sunBOT
#

Result

night bane
#

&color(hsv2rgb(hsv(hex(001155))), Result)

silver sunBOT
#

Result

night bane
#

&color(hsv2rgb(hsv(hex(7700FF))), Result)

silver sunBOT
#

Result

night bane
#

i guess the indigo is already vibrant

#

&color(hsv2rgb(vibrant(hsv(hex(123456)))), Result)

silver sunBOT
#

Result

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(lshift(storage(L), 16), or(lshift(storage(L), 8), storage(L)))
)

silver sunBOT
#

Added Function: grayscale()

night bane
#

,color(grayscale(hex(FF0000)), Grayscale!)

#

&color(grayscale(hex(FF0000)), Grayscale!)

silver sunBOT
#

Grayscale!

night bane
#

&color(grayscale(hex(00FFFF)), Grayscale!)

silver sunBOT
#

Grayscale!

night bane
#

&color(grayscale(hex(00FF00)), Grayscale!)

silver sunBOT
#

Grayscale!

night bane
#

amazing

night bane
#

.function show rgb

silver sunBOT
#
__**Function Source**__
rgb
color(hsv2rgb(array(random(360), 1, 1)), ${1})

Owner: @night bane

night bane
#

.function add mycolor color(hsv2rgb(array(random(360, userid(${1})), 1, 1)), ${1})

silver sunBOT
#

Added Function: mycolor()

night bane
#

&mycolor(@night bane)

silver sunBOT
#

@night bane

night bane
#

color based on your user id ๐Ÿ˜›

bright dock
#

&mycolor(@bright dock)

silver sunBOT
#

@bright dock

bright dock
#

That's cool!

night bane
#

.function add mycolor color(hsv2rgb(array(random(360, context(author)), 1, 1)), ${1})

silver sunBOT
#

Added Function: mycolor()

night bane
#

.function add mycolor color(hsv2rgb(array(random(360, context(author)), 1, 1)), concat(<@, context(author), >))

silver sunBOT
#

Added Function: mycolor()

night bane
#

&mycolor()

silver sunBOT
#

@night bane

night bane
#

added a context function

night bane
silver sunBOT
night bane
#

Image manipulation!

#

Original image

#

Uh oh

#

.curse the twilight

#

oh its offline

silver sunBOT
night bane
#

OH

#

IT WORKED

#

it took forever

silver sunBOT
#

Value must be encased in [ ]

bright dock
#

๐Ÿ˜ฎ

night bane
#

It's very slow lol

silver sunBOT
#

java.lang.NumberFormatException: For input string: "[63.33333333333332, 1, 1]"

in function:
pixels()

night bane
#

Bleh

#

I'll figure it out in a bit

bright dock
#

Iโ€™m trying to not brainstorm a shader-based solution and thatโ€™s brutal

night bane
#

Oh I know

#

Ok bots dead until that's done

#

I should be executing these on a new thread

night bane
#

I ended up restarting the bot

#

lol

#

converting to hsv on each pixel was a bad idea

#

lets try a smaller image

silver sunBOT
#

Evaluating...

night bane
#

&test

silver sunBOT
#

test

night bane
#

cool

#

new threads ๐Ÿ˜›

#

trying this instead

silver sunBOT
night bane
#

lol

#

i think the alpha got fucked

#

.function show grayscale

silver sunBOT
#
__**Function Source**__
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)))
)

Owner: @night bane

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))))
)

silver sunBOT
#

Added Function: grayscale()

night bane
silver sunBOT
#

Evaluating...

#

java.lang.NumberFormatException: For input string: "2319400767"

in function:
pixels()

night bane
#

&tohex(grayscale(hex(AABBCCDD)))

silver sunBOT
#

AACFCFCF

night bane
#

&grayscale(hex(AABBCCDD))

silver sunBOT
#

2865745871

night bane
silver sunBOT
night bane
#

nice

#

hsv conversion really slogs it down

silver sunBOT
night bane
#

what

#

my hsv function cant handle alpha

silver sunBOT
night bane
#

oh god

silver sunBOT
median badger
night bane
silver sunBOT
night bane
#

lol

night bane
silver sunBOT
#

Evaluating...

#

java.lang.NumberFormatException: For input string: "0.0"

in function:
random()

night bane
silver sunBOT
night bane
silver sunBOT
night bane
silver sunBOT
#

Evaluating...

#

java.lang.NumberFormatException: For input string: "0.0"

in function:
or()

night bane
silver sunBOT
night bane
#

gradient hydra

silver sunBOT
night bane
silver sunBOT
night bane
silver sunBOT
night bane
silver sunBOT
#

Evaluating...

#

java.lang.NumberFormatException: For input string: "FF00FFFF"

in function:
and()

night bane
silver sunBOT
night bane
#

&mycolor()

silver sunBOT
#

@night bane

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

bright dock
#

Ooo, that is a great optimization

night bane
#

actually my test was on prod

#

not dev

#

oops

#

,function list

silver sunBOT
#
__**Functions**__
execute
index(array(${1}, ${2}), 1)

Owner: @night bane

night bane
#

,eval latestTwilightForest()

silver sunBOT
#

[]

night bane
#

,eval execute(store(asdf, test), storage(asdf))

silver sunBOT
#

[test, test]

night bane
#

welllll thats a problem

#

,eval execute(store(a, b), execute(store(asdf, test), concat(storage(asdf), storage(a))))

silver sunBOT
#

[b, [[test, testb], 1]]

night bane
#

christ

#

,eval execute(store(a, b), storage(a))

silver sunBOT
#

b

night bane
#

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))

silver sunBOT
#

bc

night bane
#

,eval execute(store(d, e), execute(store(a, b), concat(storage(a), c, storage(d))))

silver sunBOT
#

bce

night bane
#

ok its baby induction time, i'll come back to this ๐Ÿ˜›

night bane
#

I can't even remote desktop into my PC to finish the code :(
I forgot to turn it on before I left

stable birch
#

keep us posted

night bane
#

.function add isEven boolean(and(not(${1}), 1))

silver sunBOT
#

Added Function: isEven()

night bane
#

&isEven(0)

silver sunBOT
#

boolean(and(not(0), 1))

night bane
#

Oh

#

.function add isEven equal(and(not(${1}), 1), 1)

silver sunBOT
#

Added Function: isEven()

night bane
#

&isEven(0)

silver sunBOT
#

false

night bane
#

.function add isEven equal(and(not(${1}), 1), long(1))

silver sunBOT
#

Added Function: isEven()

night bane
#

&isEven(0)

silver sunBOT
#

true

night bane
#

&isEven(1)

silver sunBOT
#

false

night bane
#

&long(isEven(0))

silver sunBOT
#

Evaluating...

#

java.lang.NumberFormatException: For input string: "true"

in function:
long()

night bane
#

&functions()

silver sunBOT
#
Internal Function List:
long

Convert to a Long

double

Convert to a Double

byte

Convert to a Double

btl

Convert a Boolean to a Long

ltb

Convert a Long to a Boolean

night bane
#

&btl(isEven(0))

silver sunBOT
#

1

night bane
#

.function add isEven ltb(and(not(${1}), 1))

silver sunBOT
#

Added Function: isEven()

night bane
#

&btl(isEven(0))

silver sunBOT
#

1

night bane
#

&btl(isEven(1))

silver sunBOT
#

0

night bane
silver sunBOT
night bane
#

Oh yeah 1 isn't white

silver sunBOT
#

Evaluating...

#

java.lang.NumberFormatException: For input string: "1.6777215E7"

in function:
or()

night bane
silver sunBOT
night bane
#

.function add ubyte byte(if(less(127, ${1}), ->sub(${1}, 256), ->${1}))

silver sunBOT
#

Added Function: ubyte()

night bane
#

&ubyte(255)

silver sunBOT
#

Evaluating...

#

java.lang.NumberFormatException: For input string: "-1.0"

in function:
byte()

night bane
#

.function add ubyte byte(long(if(less(127, ${1}), ->sub(${1}, 256), ->${1})))

silver sunBOT
#

Added Function: ubyte()

night bane
#

&ubyte(255)

silver sunBOT
#

-1

night bane
#

&ubyte(128)

silver sunBOT
#

-128

night bane
#

&ubyte(127)

silver sunBOT
#

127

night bane
#

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})))

silver sunBOT
#

Added Function: sbyte()

night bane
#

.function remove ubyte

silver sunBOT
#

Function ubyte() removed!

night bane
#

&sbyte(257)

silver sunBOT
#

1

night bane
#

Oh god

#

&sbyte(512)

silver sunBOT
#

Evaluating...

#

java.lang.NumberFormatException: Value out of range. Value:"256" Radix:10

in function:
byte()

night bane
#

ok performance patch done

#

lets see how long this takes

#

last time it took 9 mins

#

seems to be taking just as long if not longer

silver sunBOT
night bane
#

ok just as long

#

very interesting

#

even without the string parsing its still pretty expensive

bright dock
#

@main warren

night bane
#

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

night bane
#

.function add pi 3.1415926535897932

silver sunBOT
#

Added Function: pi()

night bane
#

&pi()

silver sunBOT
#

3.1415926535897932

night bane
#

.function add pi double(3.1415926535897932)

silver sunBOT
#

Added Function: pi()

night bane
#

&pi()

silver sunBOT
#

3.141592653589793

night bane
#

.function add pi double(3.141592653589793)

silver sunBOT
#

Added Function: pi()

night bane
#

.function add rad mul(${1}, div(pi(), 180))

silver sunBOT
#

Added Function: rad()

night bane
#

&rad(1)

silver sunBOT
#

0.017453292519943295

night bane
#

.function add deg mul(${1}, div(180, pi()))

silver sunBOT
#

Added Function: deg()

night bane
#

&deg(0.017453292519943295)

silver sunBOT
#

1.0

night bane
#

&rad(360)

silver sunBOT
#

6.283185307179586

night bane
#

&rad(180)

silver sunBOT
#

3.141592653589793

night bane
#

&sin(rad(0))

silver sunBOT
#

0.0

night bane
#

&sin(rad(90))

silver sunBOT
#

1.0

night bane
#

&sin(rad(180))

silver sunBOT
#

1.2246467991473532E-16

night bane
#

&sin(rad(360))

silver sunBOT
#

-2.4492935982947064E-16

night bane
#

&double(2.2204460492503130808472633361816E-16)

silver sunBOT
#

2.220446049250313E-16

night bane
#

.function add epsilon double(2.220446049250313E-16)

silver sunBOT
#

Added Function: epsilon()

night bane
#

&execute(store(result, sin(rad(180))), if(less(storage(result), epsilon()), 0, storage(result)))

silver sunBOT
#

0

night bane
#

&abs(-1)

silver sunBOT
#

1.0

night bane
#

.function add precise execute(
store(result, ${1}),
if(
less(abs(storage(result)), epsilon()),
0,
storage(result)
)
)

silver sunBOT
#

Added Function: precise()

night bane
#

&precise(sin(rad(180)))

silver sunBOT
#

0

night bane
#

&precise(sin(rad(181)))

silver sunBOT
#

-0.017452406437283637

night bane
#

&precise(sin(rad(360)))

silver sunBOT
#

-2.4492935982947064E-16

night bane
#

&precise(sin(rad(0)))

silver sunBOT
#

0

night bane
#

blah

night bane
#

,eval consume(
attach(
aimage(cimage(100, 100))
)
)

silver sunBOT
#

Evaluating...

night bane
#

,eval consume(
attach(
aimage(cimage(100, 100))
)
)

silver sunBOT
night bane
#

,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))
)
)

silver sunBOT
#

Evaluating...

night bane
#

,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))
)
)

silver sunBOT
#

Evaluating...

night bane
#

,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)))
)
)