// color_oscillator.hpp - Sistema d'oscil·lació de color per efecte CRT
// © 2025 Port a C++20 amb SDL3

#pragma once
#include <SDL3/SDL.h>

namespace Rendering {

class ColorOscillator {
    public:
        ColorOscillator();

        void update(float delta_time);

        [[nodiscard]] SDL_Color getCurrentLineColor() const { return current_line_color_; }
        [[nodiscard]] SDL_Color getCurrentBackgroundColor() const {
            return current_background_color_;
        }

    private:
        float accumulated_time_;
        SDL_Color current_line_color_;
        SDL_Color current_background_color_;

        static float calculateOscillationFactor(float time, float frequency);
        static SDL_Color interpolateColor(SDL_Color min, SDL_Color max, float factor);
};

}  // namespace Rendering
