{"size": 1616, "ext": "scrbl", "max_stars_repo_path": "draw-doc/scribblings/draw/brush-list-class.scrbl", "max_stars_repo_name": "Bogdanp/draw", "max_stars_repo_stars_event_min_datetime": "2015-03-24T15:04:13.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-25T03:43:21.000Z", "max_issues_repo_path": "draw-doc/scribblings/draw/brush-list-class.scrbl", "max_issues_repo_name": "Bogdanp/draw", "max_issues_repo_issues_event_min_datetime": "2015-01-30T20:28:55.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-02T08:43:11.000Z", "max_forks_repo_path": "draw-doc/scribblings/draw/brush-list-class.scrbl", "max_forks_repo_name": "Bogdanp/draw", "max_forks_repo_forks_event_min_datetime": "2015-01-29T22:12:33.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-17T09:51:49.000Z"}
{"max_stars_count": 15, "max_issues_count": 37, "max_forks_count": 21, "avg_line_length": 39.4146341463, "max_line_length": 85, "alphanum_fraction": 0.4962871287}
#lang scribble/doc
@(require "common.rkt")

@defclass/title[brush-list% object% ()]{

A @racket[brush-list%] object maintains a list of @racket[brush%]
 objects to avoid creating brushes repeatedly. A @racket[brush%]
 object in a brush list cannot be mutated.

A global brush list, @racket[the-brush-list], is created
 automatically.


@defconstructor[()]{

Creates an empty brush list.

}

@defmethod*[([(find-or-create-brush [color (or/c string? (is-a?/c color%))]
                                    [style (or/c 'transparent 'solid 'opaque
                                                 'xor 'hilite 'panel 
                                                 'bdiagonal-hatch 'crossdiag-hatch 
                                                 'fdiagonal-hatch 'cross-hatch 
                                                 'horizontal-hatch 'vertical-hatch)])
              (is-a?/c brush%)]
             [(find-or-create-brush [color-name string?]
                                    [style (or/c 'transparent 'solid 'opaque 
                                                 'xor 'hilite 'panel 
                                                 'bdiagonal-hatch 'crossdiag-hatch 
                                                 'fdiagonal-hatch 'cross-hatch 
                                                 'horizontal-hatch 'vertical-hatch)])
              (or/c (is-a?/c brush%) #f)])]{

Finds a brush of the given specification, or creates one and adds it
 to the list. See @racket[brush%] for a further explanation of the
 arguments, which are the same as @racket[brush%]'s initialization
 arguments.

}}
