Skip to content

Instantly share code, notes, and snippets.

View jhyland87's full-sized avatar

J jhyland87

View GitHub Profile
@av01d
av01d / ColorSteps.js
Last active February 27, 2024 15:42
Javascript calculate color steps (gradient) between two colors
const ColorSteps = (() => {
/**
* Convert any color string to an [r,g,b,a] array.
* @author Arjan Haverkamp (arjan-at-avoid-dot-org)
* @param {string} color Any color. F.e.: 'red', '#f0f', '#ff00ff', 'rgb(x,y,x)', 'rgba(r,g,b,a)', 'hsl(180, 50%, 50%)'
* @returns {array} [r,g,b,a] array. Caution: returns [0,0,0,0] for invalid color.
* @see https://gist.github.com/av01d/8f068dd43447b475dec4aad0a6107288
*/
const colorValues = color => {
@vladbabii
vladbabii / klipper_printer_gcode_incremental_macro.cfg
Created December 8, 2019 13:57
klipper printer gcode incremental macro
#
# set start/end with gcode:
#
# SET_GCODE_VARIABLE MACRO=incremental_settings VARIABLE=start VALUE=2
# SET_GCODE_VARIABLE MACRO=incremental_settings VARIABLE=now VALUE=2
# SET_GCODE_VARIABLE MACRO=incremental_settings VARIABLE=end VALUE=5
#
# if you set now on each toolchange, if it runs out, the next tool will be used
#
# then run gcode: