Skip to content

Instantly share code, notes, and snippets.

View haschdl's full-sized avatar

Half Scheidl haschdl

View GitHub Profile
@haschdl
haschdl / OpenSimplexNoise.java
Created July 23, 2018 20:30 — forked from KdotJPG/OpenSimplex2S.java
Visually axis-decorrelated coherent noise algorithm based on the Simplectic honeycomb.
/*
* OpenSimplex Noise in Java.
* by Kurt Spencer
*
* v1.1 (October 5, 2014)
* - Added 2D and 4D implementations.
* - Proper gradient sets for all dimensions, from a
* dimensionally-generalizable scheme with an actual
* rhyme and reason behind it.
* - Removed default permutation array in favor of
/*
* OpenSimplex Noise in Java.
* by Kurt Spencer
*
* v1.1 (October 5, 2014)
* - Added 2D and 4D implementations.
* - Proper gradient sets for all dimensions, from a
* dimensionally-generalizable scheme with an actual
* rhyme and reason behind it.
* - Removed default permutation array in favor of
@haschdl
haschdl / basic_voronoi
Created July 26, 2018 09:56
[ShaderToy] Basic Voronoi
/*
* Voronoi visualization
* Copy of the first approach by @The_ArtOfCode, shown at https://www.youtube.com/watch?v=l-07BXzNdPw
*
* 27.07.2018
*/
vec2 N22(vec2 p) {
vec3 a = fract(p.xyx*vec3(123.34,234.34,345.65));
a += dot(a, a+34.45);
return fract(vec2(a.x*a.y, a.y * a.z));
@haschdl
haschdl / Save.pde
Last active December 10, 2021 22:49
[Processing] A reusable "save" command, with basic and advanced modes (copy and paste into new tab in Processing)
/*
* Function for saving the generated image into a file when you press "S" or "B" key.
* Files will be saved to /out folder, with name: [Sketch name]_[Timestamp].jpg
*
* It works in two ways:
* 1. S key (BASIC)
* If you press the S key ("Save"), it will save the contents of the screen.
* The image is saved in the same resolution as your sketch size. In other words,
* the image will have the same size as "height" by "width" pixels.
*
@haschdl
haschdl / 2019-projects.md
Created December 30, 2018 11:11
2019 Possible applications?
# example on how to save Processing sketch in Python mode
# copy and paste to your sketch
from datetime import datetime
def keyPressed():
if key == 'S' or key == 's':
saveSketch()
# example on how to save Processing sketch in Python mode
import sys
import re
import os
from pathlib import Path
from shutil import copyfile
import argparse
import logging
logging.getLogger(__name__)
@haschdl
haschdl / Palette.js
Created February 17, 2020 07:51
Adobe Colors to Java array
/* This script is a quick hack to extract the HEX colors
from color.adobe.com and save it to the clipboard as a java array
I created this to import the colors in Processing.
*/
let selector = '[class^=ColorModes__colorValue_';
let elements = Array.from(document.querySelectorAll(selector));
elements = elements.filter(el => el.innerText.startsWith("#")).map(el => el.innerText);
elements = elements.map(i => "0xFF" + i.replace("#",""));
[...new Set(elements)].toString();
@haschdl
haschdl / ppt_change_color.vba
Created March 20, 2020 10:19
Change PowerPoint colors
Sub ChangeTextColors()
Dim oSl As Slide
Dim oSh As Shape
Dim x As Long
Dim lOldColor As Long
Dim lNewColor As Long
' Set lOldcolor to the RGB value you're looking for
lOldColor = RGB(205, 32, 38)
/***
* This script ungroups all items recursivele, and moves path items to 4 layers, using a round-robin approach.
*
* Context: spliting a SVG created for plotting with 4 different pen colors.
* In my workflow the SVGs are created with code using the Processing environment.
*
*
* Tested on: Illustrator CC 2020 only
* Reminder to self: ESTK is compatible with ECMA 3
*