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
function HSVToRGB( hue, saturation, value ) | |
-- Returns the RGB equivalent of the given HSV-defined color | |
-- (adapted from some code found around the web) | |
-- If it's achromatic, just return the value | |
if saturation == 0 then | |
return value; | |
end; | |
-- Get the hue sector |
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
function getInterequidistantlyScaledFrames( count, padding, dimension, alignment ) | |
-- Returns a table containing `count` Frame objects with `padding` | |
-- percent of the frame size (on a scale from 0 to 1) of spacing in | |
-- between each frame in the "x" or "y" `dimension`, aligned to the | |
-- "left", "center", or "right" (or, along the y-axis, "top", | |
-- "center", or "bottom") | |
local frames = {}; | |
-- Calculate the size of each frame considering the padding in |
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
function _trimString( str ) | |
-- Returns string `str` without leading/trailing whitespace | |
return ( str:gsub( "^%s*(.-)%s*$", "%1" ) ); | |
end; | |
function _countStringOccurrences( haystack, needle ) | |
-- Returns the amount of occurrences of a pattern in a string | |
local count = 0; | |
for _ in haystack:gmatch( needle ) do |