Add better timings, and proper configuration

This commit is contained in:
TennesseeTrash 2025-06-08 00:23:46 +02:00
parent 0b32af33b8
commit 5750bb8177
13 changed files with 385 additions and 240 deletions

View 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,
};
}
}