This file contains hidden or 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
| // adapted from https://labex.io/tutorials/28378 | |
| float3 HSL2RGB(float h, float s, float l) { | |
| float a = s * min(l, 1. - l); | |
| return float3( | |
| l - a * max(-1., min(((h / 30.) % 12.) - 3., min(9. - ((h / 30.) % 12.), 1.))), | |
| l - a * max(-1., min(((8. + h / 30.) % 12.) - 3., min(9. - ((8. + h / 30.) % 12.), 1.))), | |
| l - a * max(-1., min(((4. + h / 30.) % 12.) - 3., min(9. - ((4. + h / 30.) % 12.), 1.))) | |
| ); | |
| } | |
| float3 HSL2RGB(float3 hsl) { |
This file contains hidden or 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
| local scriptFileName = stringSplit(scriptName, '/') | |
| scriptFileName = scriptFileName[#scriptFileName] | |
| local src = scriptName:sub(1, - #scriptFileName - 1) | |
| local function warn() | |
| debugPrint('Please download and put RalLib into the same folder as script.') | |
| debugPrint('RalLib.lua file is not present in the scripts directory.') | |
| debugPrint('') | |
| debugPrint('') | |
| end | |
| if buildTarget == 'windows' then -- windows |