/*============================================================================== Copyright 2018 by Roland Rabien For more information visit www.rabiensoftware.com ==============================================================================*/ Colour goldenRatioColor (int idx) { double h = std::fmod (idx * 0.618033988749895, 1); return Colour (float (h), 0.8f, 0.95f, 1.0f); } //============================================================================== int versionStringToInt (const String& versionString) { StringArray parts; parts.addTokens (versionString, ".", ""); parts.trim(); parts.removeEmptyStrings(); int res = 0; for (auto part : parts) res = (res << 8) + part.getIntValue(); return res; } //============================================================================== class DelayedLambdaHelper : public Timer { public: DelayedLambdaHelper (std::function& cb, int ms) : callback (cb) { startTimer (ms); } void timerCallback() override { callback(); delete this; } std::function callback; }; void delayedLambda (std::function callback, int delayMS) { new DelayedLambdaHelper (callback, delayMS); }