<commit_before>/// <reference path="Brush.ts" />
/// CODE
/// <reference path="../Primitives/Color.ts" />

module Fayde.Media {
    export class SolidColorBrush extends Brush {
        static ColorProperty: DependencyProperty = DependencyProperty.Register("Color", () => Color, SolidColorBrush, undefined, (d, args) => (<Brush>d).InvalidateBrush());
        Color: Color;

        constructor() {
            super();
            if (arguments.length === 1 && arguments[0] instanceof Color)
                this.Color = arguments[0];
        }

        static FromColor(color: Color): SolidColorBrush {
            var scb = new SolidColorBrush();
            scb.Color = color;
            return scb;
        }

        CreateBrush(ctx: CanvasRenderingContext2D, bounds: rect): any {
            var color = this.Color;
            if (!color)
                return "#000000";
            return color.toString();
        }
    }
    Fayde.RegisterType(SolidColorBrush, {
    	Name: "SolidColorBrush",
    	Namespace: "Fayde.Media",
    	XmlNamespace: Fayde.XMLNS
    });

    function brushConverter(val: any): Brush {
        if (!val)<commit_msg>Added ability to specify Color in SolidColorBrush ctor.<commit_after>/// <reference path="Brush.ts" />
/// CODE
/// <reference path="../Primitives/Color.ts" />

module Fayde.Media {
    export class SolidColorBrush extends Brush {
        static ColorProperty: DependencyProperty = DependencyProperty.Register("Color", () => Color, SolidColorBrush, undefined, (d, args) => (<Brush>d).InvalidateBrush());
        Color: Color;

        constructor(...args: any[]) {
            super();
            if (args && args.length === 1 && args[0] instanceof Color)
                this.Color = args[0];
        }

        static FromColor(color: Color): SolidColorBrush {
            var scb = new SolidColorBrush();
            scb.Color = color;
            return scb;
        }

        CreateBrush(ctx: CanvasRenderingContext2D, bounds: rect): any {
            var color = this.Color;
            if (!color)
                return "#000000";
            return color.toString();
        }
    }
    Fayde.RegisterType(SolidColorBrush, {
    	Name: "SolidColorBrush",
    	Namespace: "Fayde.Media",
    	XmlNamespace: Fayde.XMLNS
    });

    function brushConverter(val: any): Brush {
        if (!val)
{'fraction_non_alphanumeric': 0.1296217594560136, 'fraction_numerical': 0.008499787505312367, 'mean_word_length': 2.142857142857143, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '6739652', 'n_tokens_mistral': 706, 'n_tokens_neox': 638, 'n_words': 156}