This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This file is in the public domain. Peter O., 2012. http://upokecenter.dreamhosters.com | |
Public domain dedication: http://creativecommons.org/publicdomain/zero/1.0/legalcode */ | |
/* NOTE: Currently supports lines only */ | |
function RectAccum(){ | |
this.left=0; | |
this.top=0; | |
this.right=0; | |
this.bottom=0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This file is in the public domain. Peter O., 2012. http://upokecenter.dreamhosters.com | |
Public domain dedication: http://creativecommons.org/publicdomain/zero/1.0/ */ | |
using System; | |
namespace PeterO | |
{ | |
public class ColorUtil | |
{ | |
// Assumes hsv[0] is from 0-360, and hsv[1] and hsv[2] are from 0-1 | |
public static double[] HsvToHls(double[] hsv){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Gets a timing function from a "transition-timing-function" string | |
// Written by Peter O. in 2012, released to the public domain | |
// Returns the function itself if the object passed in is a Function object, | |
// or the "ease" function if the object is null or undefined | |
// This file is in the public domain. Peter O., 2012. http://upokecenter.dreamhosters.com | |
// Public domain dedication: http://creativecommons.org/publicdomain/zero/1.0/ | |
function getTimingFunction(f){ | |
if(typeof f=="undefined" || f==null)f="ease"; | |
if(typeof f=="function" || (f && f.constructor==Function))return f; | |
if(f=="step-start")return function(v){ return (v>0) ? 1.0 : 0 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file is in the public domain. Peter O., 2013. http://upokecenter.dreamhosters.com | |
// Public domain dedication: http://creativecommons.org/publicdomain/zero/1.0/ | |
using System; | |
using System.Reflection; | |
namespace PeterO | |
{ | |
public static class ReflectionUtil { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file is in the public domain. Peter O., 2013. http://upokecenter.dreamhosters.com | |
// Public domain dedication: http://creativecommons.org/publicdomain/zero/1.0/ | |
package com.upokecenter.util; | |
import java.lang.reflect.Constructor; | |
import java.lang.reflect.Field; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
public final class Reflection { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Written by Peter O. 2013. In the public domain. | |
// http://creativecommons.org/publicdomain/zero/1.0/ | |
Color BlendColors(Color crDst, Color crSrc, byte alpha){ | |
switch(alpha){ | |
case 0x00:return crDst; | |
case 0xFF:return crSrc; | |
default:{ | |
int r,g,b,a; | |
r=crDst.R; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Written by Peter O. | |
// Any copyright to this work is released to the Public Domain. | |
// https://creativecommons.org/publicdomain/zero/1.0/ | |
// | |
// | |
// | |
using System; | |
using System.Collections.Generic; | |
using System.Globalization; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.upokecenter.util; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
// Written by Peter O. in 2013. | |
// Any copyright is dedicated to the Public Domain. | |
// http://creativecommons.org/publicdomain/zero/1.0/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# Utility methods for Ruby. Peter O., 2013-2019. | |
# Any copyright to this work is released to the Public Domain. | |
# https://creativecommons.org/publicdomain/zero/1.0/ | |
# | |
# | |
require 'digest' | |
require 'fileutils' | |
require 'json' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///////////////////////////////////////////////////////////// | |
// | |
// LESS functions for enabling beautiful typography | |
// in Web pages. Written by Peter O., 2013-2015. | |
// | |
// Any copyright is dedicated to the Public Domain. | |
// http://creativecommons.org/publicdomain/zero/1.0/ | |
// | |
// If you like this, you should donate to Peter O. | |
// at: http://upokecenter.dreamhosters.com/articles/donate-now-2/ |
OlderNewer