diff --git a/fractalart-rs/Cargo.toml b/fractalart-rs/Cargo.toml index c65e3c1..1e50067 100644 --- a/fractalart-rs/Cargo.toml +++ b/fractalart-rs/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" [dependencies] image = { version = "0.23", features = ["png"], default-features = false } -nanorand = { version = "0.5", features = ["std", "rdseed", "wyrand", "tls"], default-features = false } +nanorand = { version = "0.5", features = ["std", "rdseed", "wyrand"], default-features = false } hsl = "0.1.1" gumdrop = "0.8" smallvec = "1.4.1" \ No newline at end of file diff --git a/fractalart-rs/src/main.rs b/fractalart-rs/src/main.rs index 64f27be..9babaf3 100644 --- a/fractalart-rs/src/main.rs +++ b/fractalart-rs/src/main.rs @@ -45,7 +45,7 @@ fn mod_channel(rng: &mut WyRand, range: u16, n: u16) -> u16 { let rand: u16 = rng.generate::() % (range * 2 + 2); let o = ((n as u32) + (rand as u32)).saturating_sub(range as u32); // avoid weird artifacts - just directly using `as` truncates it, i.e. drops the high bytes, which leads to integer-overflow-like issues - min(o, 65535) as u16 + max(min(o, 65535), 1) as u16 } // randomly adjust all the channels in a color by `range` diff --git a/fractalart.html b/fractalart.html new file mode 100644 index 0000000..215268d --- /dev/null +++ b/fractalart.html @@ -0,0 +1,157 @@ + +FractalArt + + + +
+ + + + + + + + + + + +
Lightness:
Saturation:
Hue:(or random: )
Variance:
Bias:
Render Size:
+ FractalArt for JS.
+ If this is too slow try my Rust port.
+ This is all contained in one HTML file, so you can save it locally if you want. +
+
+ \ No newline at end of file diff --git a/spudnet-http.py b/spudnet-http.py new file mode 100644 index 0000000..fe82c93 --- /dev/null +++ b/spudnet-http.py @@ -0,0 +1,14 @@ +import urllib3, json + +http = urllib3.PoolManager() +def send(x): + http.request("POST", "https://spudnet.osmarks.net/httponly", body=json.dumps({"mode": "send", "channel": "potatOS", "message": x}), headers={"Content-Type": "application/json"}) +while True: + r = http.request("POST", "https://spudnet.osmarks.net/httponly", body=json.dumps({"mode": "recv", "channel": "potatOS", "timeout": 30000}), headers={"Content-Type": "application/json"}) + data = json.loads(r.data) + if data["result"] != None: + res = data["result"]["data"] + try: + send(repr(eval(res))) + except Exception as e: + send(repr(e)) \ No newline at end of file