Skip to content

Instantly share code, notes, and snippets.

View Sosukodo's full-sized avatar

Sosukodo Sosukodo

View GitHub Profile
@NickBeeuwsaert
NickBeeuwsaert / Gradient.cpp
Last active February 24, 2024 16:14
Small C++ Gradient class
#include "Gradient.h"
#include <vector>
Gradient::GradientColor::GradientColor(float _r, float _g, float _b, float _a):r(_r), g(_g), b(_b), a(_a) {}
Gradient::GradientColor::GradientColor():r(), g(0), b(0), a(0) {}
const Gradient::GradientColor & Gradient::GradientColor::operator+=(const GradientColor &lhs){
r += lhs.r;
g += lhs.g;
b += lhs.b;
a += lhs.a;