Add better timings, and proper configuration
This commit is contained in:
parent
0b32af33b8
commit
5750bb8177
13 changed files with 385 additions and 240 deletions
51
Libraries/Kanimaji/Source/Settings.cpp
Normal file
51
Libraries/Kanimaji/Source/Settings.cpp
Normal file
|
@ -0,0 +1,51 @@
|
|||
#include "Kanimaji/Settings.hpp"
|
||||
|
||||
#include <cmath>
|
||||
#include <utility>
|
||||
|
||||
namespace Kanimaji
|
||||
{
|
||||
std::string ToString(Progression progression)
|
||||
{
|
||||
switch (progression) {
|
||||
case Progression::Linear: return "linear";
|
||||
case Progression::EaseIn: return "ease-in";
|
||||
case Progression::EaseOut: return "ease-out";
|
||||
case Progression::EaseInOut: return "ease-in-out";
|
||||
|
||||
default: std::unreachable();
|
||||
};
|
||||
}
|
||||
|
||||
AnimationSettings AnimationSettings::Default()
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
return AnimationSettings {
|
||||
.StrokeProgression = Progression::EaseInOut,
|
||||
.UnfilledStroke = StrokeStyle {
|
||||
.Width = 2.0,
|
||||
.Colour = RGB::FromHex("#EEEEEE"),
|
||||
},
|
||||
.FilledStroke = StrokeStyle {
|
||||
.Width = 3.0,
|
||||
.Colour = RGB::FromHex("#000000"),
|
||||
},
|
||||
.StrokeFillingColour = RGB::FromHex("#FF0000"),
|
||||
.EnableBrush = Flag::Enable,
|
||||
.Brush = StrokeStyle {
|
||||
.Width = 5.5,
|
||||
.Colour = RGB::FromHex("#FF0000"),
|
||||
},
|
||||
.BrushBorder = StrokeStyle {
|
||||
.Width = 7.0,
|
||||
.Colour = RGB::FromHex("#666666"),
|
||||
},
|
||||
.LengthToTimeScaling = [] (double length) -> double {
|
||||
return std::pow(length, 1.0 / 3.0) / 6.0;
|
||||
},
|
||||
.WaitBeforeRepeating = 1s,
|
||||
.DelayBetweenStrokes = 50ms,
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue