<commit_before>package gengine.math;

@:native('Module.Color')
extern class Color
{
    public var r:Float;
    public var g:Float;
    public var b:Float;
    public var a:Float;

    @:selfCall
    public function new(r:Float, g:Float, b:Float, a:Float);
}<commit_msg>Updated Color<commit_after>package gengine.math;

@:native('Module.Color')
extern class ColorBase
{
    public var r:Float;
    public var g:Float;
    public var b:Float;
    public var a:Float;

    @:selfCall
    public function new(r:Float, g:Float, b:Float, a:Float);
}

@:forward
abstract Color(ColorBase) to ColorBase from ColorBase
{
    @:selfCall
    inline public function new(r:Float, g:Float, b:Float, a:Float = 1.0)
    {
        this = new ColorBase(r, g, b, a);
    }

    @:op(A * B)
    inline static public function mul(a:Color, b:Float)
    {
        return new Color(a.r * b, a.g * b, a.b * b, a.a * b);
    }

    @:op(A / B)
    inline static public function div(a:Color, b:Float)
    {
        return new Color(a.r / b, a.g / b, a.b / b, a.a / b);
    }

    @:op(A + B)
    inline static public function add(a:Color, b:Color)
    {
        return new Color(a.r + b.r, a.g + b.g, a.b + b.b, a.a + b.a);
    }

    @:op(A - B)
    inline static public function min(a:Color, b:Color)
    {
        return new Color(a.r - b.r, a.g - b.g, a.b - b.b, a.a - b.a);
    }

    public static var BLACK = new Color(0, 0, 0, 1);
    public static var WHITE = new Color(1, 1, 1, 1);
}
{'fraction_non_alphanumeric': 0.15143246930422918, 'fraction_numerical': 0.0068212824010914054, 'mean_word_length': 2.4355971896955504, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3493138', 'n_tokens_mistral': 582, 'n_tokens_neox': 566, 'n_words': 163}