Full Code of qrohlf/trianglify for AI

master b959ccd656ca cached
30 files
173.7 KB
64.4k tokens
5 symbols
1 requests
Download .txt
Repository: qrohlf/trianglify
Branch: master
Commit: b959ccd656ca
Files: 30
Total size: 173.7 KB

Directory structure:
gitextract_0pzmxqqx/

├── .babelrc
├── .browserslistrc
├── .github/
│   └── workflows/
│       └── build.yml
├── .gitignore
├── .nvmrc
├── CONTRIBUTING.md
├── LICENSE
├── Readme.md
├── changelog.txt
├── examples/
│   ├── basic-web-example.html
│   ├── color-function-example.html
│   ├── custom-points-example.html
│   ├── destsvg-example.html
│   ├── save-as-png.js
│   ├── save-as-svg.js
│   └── transparency-example.html
├── package.json
├── rollup.config.js
└── src/
    ├── __snapshots__/
    │   ├── trianglify.browser.test.js.snap
    │   └── trianglify.node.test.js.snap
    ├── pattern.js
    ├── trianglify.browser.test.js
    ├── trianglify.js
    ├── trianglify.node.test.js
    └── utils/
        ├── colorFunctions.js
        ├── colorbrewer.js
        ├── debugRender.js
        ├── geom.js
        ├── getScalingRatio.js
        └── mulberry32.js

================================================
FILE CONTENTS
================================================

================================================
FILE: .babelrc
================================================
{
  "plugins": ["@babel/plugin-proposal-class-properties"],
  "presets": [
    ["@babel/preset-env"]
  ]
}


================================================
FILE: .browserslistrc
================================================
defaults
not IE 11
not IE_Mob 11
maintained node versions


================================================
FILE: .github/workflows/build.yml
================================================
name: build

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]
    types: [synchronize]

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [10.x, 12.x, 13.x]

    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - run: npm ci # install dependencies in cleanroom
    - run: npm run ci # run the "ci" script defined in package.json


================================================
FILE: .gitignore
================================================
node_modules
dist


================================================
FILE: .nvmrc
================================================
v12


================================================
FILE: CONTRIBUTING.md
================================================
# Contributing Guidelines

Pull requests and issues are welcome! For all contributions, please:

1. Read the [Readme](Readme.md)
2. Search the existing [issues](https://github.com/qrohlf/trianglify/issues?q=is%3Aissue+) and [pull requests](https://github.com/qrohlf/trianglify/pulls?q=is%3Apr) to make sure your contribution isn't a duplicate

## Issues

If you're submitting a bug, please include the enivronment (browser/node) and relevant environment version(s) that you have encountered the bug in.

## Pull Requests

*Important: if you are submitting a pull request that does not address an open issue in the issue tracker, it would be a very good idea to create an issue to discuss your proposed changes/additions before working on them.*

1. Fork the repo on GitHub.
2. Install dependencies with `npm install`
2. Create a topic branch and make your changes.
3.  Run `npm run ci` to test your code and compile it to trianglify.min.js.
4. Submit a pull request to merge your topic branch into `master`.


================================================
FILE: LICENSE
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS


================================================
FILE: Readme.md
================================================
# Trianglify


Trianglify is a library that I wrote to generate nice SVG background images like this one:

![](https://cloud.githubusercontent.com/assets/347189/6771063/f8b0af46-d090-11e4-8d4c-6c7ef5bd9d37.png)

# Contents
[📦 Getting Trianglify](#-getting-trianglify)  
[🏎 Quickstart](#-quickstart)  
[⚖️ Licensing](#%EF%B8%8F-licensing)  
[📖 API](#-api)  
[🎨 Configuration](#-configuration)

# 📦 Getting Trianglify

You can grab Trianglify with npm/yarn (recommended):

```
npm install --save trianglify
```

Include it in your application via the unpkg CDN:

```
<script src='https://unpkg.com/trianglify@^4/dist/trianglify.bundle.js'></script>
```

Or download a .zip from the [**releases page**](https://github.com/qrohlf/trianglify/releases).


# 🏎 Quickstart

**Browsers**
```html
<script src='https://unpkg.com/trianglify@^4/dist/trianglify.bundle.js'></script>
<script>
  const pattern = trianglify({
    width: window.innerWidth,
    height: window.innerHeight
  })
  document.body.appendChild(pattern.toCanvas())
</script>
```

**Node**
```js
const trianglify = require('trianglify')
const fs = require('fs')

const canvas = trianglify({
  width: 1920,
  height: 1080
}).toCanvas()

const file = fs.createWriteStream('trianglify.png')
canvas.createPNGStream().pipe(file)
```

You can see the [`examples/`](./examples) folder for more usage examples.

The https://trianglify.io/ GUI is a good place to play around with the various configuration parameters and see their effect on the generated output, live.

# ⚖️ Licensing

The source code of Trianglify is licensed under version 3 of the GNU General Public License ([GPLv3](https://www.gnu.org/licenses/gpl-3.0.html)). This means that any websites, apps, or other projects that include the Trianglify javascript library need to be released under a compatible open-source license. If you are interested in using Trianglify in a closed-source project, please email qr@qrohlf.com to purchase a commercial license.

**However**, it's worth noting that you own the copyright to the output image files which you create using Trianglify, just like you own the copyright to an image created using something like [GIMP](https://www.gimp.org/). If you just want to use an image file that was generated using Trianglify in your project, and do not plan to distribute the Trianglify source code or compiled versions of it, you do not need to worry about the license restrictions described above.


# 📖 API

Trianglify is primarily used by calling the `trianglify` function, which returns a `trianglify.Pattern` object.

```js
// load the library, either via a window global (browsers) or require call (node)
// in es-module environments, you can `import trianglify from 'trianglify'` as well
const trianglify = window.trianglify || require('trianglify')

const options = { height: 400, width: 600 }
const pattern = trianglify(options)
console.log(pattern instanceof trianglify.Pattern) // true
```

## pattern

This object holds the generated geometry and colors, and exposes a number of methods for rendering this geometry to the DOM or a Canvas.


**`pattern.opts`**

Object containing the options used to generate the pattern.


**`pattern.points`**

The pseudo-random point grid used for the pattern geometry, in the following format:

```js
[
  [x, y],
  [x, y],
  [x, y],
  // and so on...
]
```


**`pattern.polys`**

The array of colored polygons that make up the pattern, in the following format:

```js
// {x, y} center of the first polygon in the pattern
pattern.polys[0].centroid

// [i, i, i] three indexes into the pattern.points array, 
// defining the shape corners
pattern.polys[0].vertexIndices

// Chroma.js color object defining the color of the polygon
pattern.polys[0].color
```


**`pattern.toSVG(destSVG?, svgOpts?)`**

Rendering function for SVG. In browser or browser-like (e.g. JSDOM) environments, this will return a SVGElement DOM node. In node environments, this will return a lightweight node tree structure that can be serialized to a valid SVG string using the `toString()` function.

If an existing svg element is passed as the `destSVG`, this function will render the pattern to the pre-existing element instead of creating a new one.

The `svgOpts` option allows for some svg-specific customizations to the output:

```js
const svgOpts = {
  // Include or exclude the xmlns='http://www.w3.org/2000/svg' attribute on
  // the root <svg> tag. See https://github.com/qrohlf/trianglify/issues/41
  // for additional details on why this is sometimes important
  includeNamespace: true,
  // Controls how many decimals to round coordinate values to.
  // You can set this to -1 to disable rounding. Default is 1.
  coordinateDecimals: 1
}
```


**`pattern.toSVGTree(svgOpts?)`**

Alternate rendering function for SVG. Returns a lightweight node tree structure that can be seralized to a valid SVG string using the `toString()` function. In node environments, this is an alias for
`pattern.toSVG()`.


**`pattern.toCanvas(destCanvas?, canvasOpts?)`**

Rendering function for canvas. In browser and browser-like environments, returns a Canvas HTMLElement node. In node environments, this will return a node-canvas object which follows [a superset of the Web Canvas API](https://github.com/Automattic/node-canvas#documentation).

If an existing canvas element is passed as the `destCanvas`, this function will render the pattern to the pre-existing element instead of creating a new one.

To use this in a node.js environment, the optional dependency [node-canvas](https://github.com/Automattic/node-canvas) needs to be installed as a dependency of your project `npm install -save canvas`.

The `canvasOpts` option allows for some canvas-specific customizations to the output:

```js
const canvasOpts = {
  // determines how the canvas is rendered on high-DPI (aka "retina") devices.
  // - 'auto' will automatically render the canvas at the appropriate scale ratio
  //   for pixel-perfect display.
  // - a numeric value will render the canvas at that specific scale factor
  //   for example, 2.0 will render it at 2x resolution, wheras 0.5 will render
  //   at half resolution
  // - 'false' will disable scaling, and the canvas will be rendered at the 
  //   exact resolution specified by `width, height`
  scaling: 'auto',
  // if the canvas is rendered at a different resolution than the {width, height}
  // trianglify will apply some inline style attributes to scale it back to
  // the requested {width, height} options. Set applyCssScaling to false to 
  // disable this behavior.
  applyCssScaling: true
}
```

# 🎨 Configuration

Trianglify is configured by an options object passed in as the only argument. The following option keys are supported, see below for a complete description of what each option does.

```js
const defaultOptions = {
  width: 600,
  height: 400,
  cellSize: 75,
  variance: 0.75,
  seed: null,
  xColors: 'random',
  yColors: 'match',
  fill: true,
  palette: trianglify.colorbrewer,
  colorSpace: 'lab',
  colorFunction: trianglify.colorFunctions.interpolateLinear(0.5),
  strokeWidth: 0,
  points: null
}
```

**`width`**

Integer, defaults to `600`. Specify the width in pixels of the pattern to generate.

**`height`**

Integer, defaults to `400`. Specify the height in pixels of the pattern to generate.

**`cellSize`**

Integer, defaults to `75`. Specify the size in pixels of the mesh used to generate triangles. Larger values will result in coarser patterns, smaller values will result in finer patterns. Note that very small values may dramatically increase the runtime of Trianglify.

**`variance`**

Decimal value between 0 and 1 (inclusive), defaults to `0.75`. Specify the amount of randomness used when generating triangles. You may set this higher than 1, but doing so may result in patterns that include "gaps" at the edges.

**`seed`**

String, defaults to `null`. Seeds the random number generator to create repeatable patterns. When set to null, the RNG will be seeded with random values from the environment. An example usage would be passing in blog post titles as the seed to generate unique but consistient trianglify patterns for every post on a blog site.

**`xColors`**

False, string, or array of CSS-formatted colors, default is `'random'`. Specify the color gradient used on the x axis.

Valid string values are 'random', or the name of a [colorbrewer palette](http://bl.ocks.org/mbostock/5577023) (i.e. 'YlGnBu' or 'RdBu'). When set to 'random', a gradient will be randomly selected from the colorbrewer library.

Valid array values should specify the color stops in any CSS format (i.e. `['#000000', '#4CAFE8', '#FFFFFF']`).

**`yColors`**

False, string or array of CSS-formatted colors, default is `'match'`. When set to 'match' the x-axis color gradient will be used on both axes. Otherwise, accepts the same options as xColors.

**`palette`**

The array of color combinations to pick from when using `random` for the xColors or yColors. See [`src/utils/colorbrewer.js`](./src/utils/colorbrewer.js) for the format of this data.

**`colorSpace`**

String, defaults to `'lab'`. Set the color space used for generating gradients. Supported values are rgb, hsv, hsl, hsi, lab and hcl. See this [blog post](https://vis4.net/blog/posts/avoid-equidistant-hsv-colors/) for some background on why this matters.

**`colorFunction`**

Specify a custom function for coloring triangles, defaults to `null`. Accepts a function to override the standard gradient coloring, which is passed a variety of data about the pattern and each polygon and must return a Chroma.js color object.

See [`examples/color-function-example.html`](./examples/color-function-example.html) and [`src/utils/colorFunctions.js`](./src/utils/colorFunctions.js) for more information about the built-in color functions, and how to write custom color functions.

**`fill`**

Boolean, defaults to `true`. Specifies whether the polygons generated by Trianglify should be filled in.

**`strokeWidth`**

Number, defaults to 0. Specify the width of the strokes used to outline the polygons. This can be used in conjunction with `fill: false` to generate weblike patterns.

**`points`**

Array of points ([x, y]) to triangulate, defaults to null. When not specified an array randomised points is generated filling the space. Points must be within the coordinate space defined by `width` and `height`. See [`examples/custom-points-example.html`](./examples/custom-points-example.html) for a demonstration of how this option can be used to generate circular trianglify patterns.


================================================
FILE: changelog.txt
================================================
v4
- ground-up port to ES2015
- support for node-canvas 2.6
- comprehensive test suite
- support for rendering wireframe patterns (no fill, just stroke)
- colorFunction has a new method signature that allows for more powerful customization
- new built-in colorFunctions: 'sparkle' and 'shadows'
- all-new example code, see examples directory
- all option keys are now camelCase, not snake_case
- antialiasing issues resolved for both SVG and Canvas rendering engines (#87, #30, #76)
- canvas rendering is now retina-ready by default
- removed dependency on seedrandom
- removed dependency on jsdom

v3
- close paths when rendering to canvas (thanks @Allidylls)
- bump a few dependencies for security


================================================
FILE: examples/basic-web-example.html
================================================
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Trianglify Basic Example</title>
    <style>
    html, body {
      margin: 0 0;
      padding: 0 0;
      text-align: center;
      font-size: 0;
      background: #000;
    }

    svg, canvas {
      padding-bottom: 30px;
      text-align: center;
    }
    </style>
  </head>
  <body>
  <!-- This is the standalone build of Trianglify. It's easy to drop in to a
  project without any need for bundlers or dependency management, but in most
  modern web projects you will probably want to use the NPM module instead -->
  <script src="../dist/trianglify.bundle.debug.js"></script>
  <script>
    const pattern = trianglify({
      cellSize: 50,
      width: window.innerWidth * 0.8,
      height: (window.innerHeight - 4 * 30) / 4
    })

    // Render to SVG
    document.body.appendChild(pattern.toSVG())
    // Render to Canvas
    document.body.appendChild(pattern.toCanvas())

    // stroke-only
    const strokeOnly = trianglify({
      cellSize: 75,
      width: window.innerWidth * 0.8,
      height: (window.innerHeight - 4 * 30) / 4,
      fill: false,
      strokeWidth: 1
    })
    document.body.appendChild(strokeOnly.toSVG())
    document.body.appendChild(strokeOnly.toCanvas())
  </script>
  </body>
</html>


================================================
FILE: examples/color-function-example.html
================================================
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Trianglify Basic Example</title>
    <style>
    html, body {
      margin: 0 0;
      padding: 0 0;
      text-align: center;
      background: #000;
      font-family: system-ui;
    }

    h1 {
      font-size: 18px;
    }

    .demo {
      background: #FFF;
      display: inline-block;
      padding: 20px;
      margin: 20px;
    }
    </style>
  </head>
  <body>
  <!-- This is the standalone build of Trianglify. It's easy to drop in to a
  project without any need for bundlers or dependency management, but in most
  modern web projects you will probably want to use the NPM module instead -->
  <script src="../dist/trianglify.bundle.debug.js"></script>
  <script>

    const JITTER_FACTOR = 0.2


    // utility for building up HTML trees
    const h = (tagName, attrs = {}, children = []) => {
      const elem = document.createElement(tagName)
      attrs && Object.keys(attrs).forEach(
        k => attrs[k] !== undefined && elem.setAttribute(k, attrs[k])
      )
      children && children.forEach(c => elem.appendChild(c))
      return elem
    }

    const addToPage = (pattern, description) => {
      document.body.appendChild(h('div', {'class': 'demo'}, [
          pattern.toCanvas(),
          h('h1', null, [document.createTextNode(description)])
        ]
      ))
    }

    // use the same seed for everything, to allow for easier comparisons
    const seed = 'pears'

    // Example 1: you can use the built-in color functions to customize the
    // color rendering of Trianglify. Here, we use the 'sparkle' color
    // function to apply a 10% jitter to the normal color gradients, which
    // will yield a glitter-like effect.
    const sparkle = trianglify({
      seed,
      width: 400,
      height: 300,
      cellSize: 15,
      colorFunction: trianglify.colorFunctions.sparkle(0.2)
    })
    addToPage(sparkle, 'trianglify.colorFunctions.sparkle(0.2)')

    // Example 2: you can use the interpolateLinear color function to
    // customize how much the x or y gradient dominates the image.
    // Higher values for the bias will result in a more pronounced x-gradient,
    // while lower values will results in a more pronounced y-gradient
    const interpolate = trianglify({
      seed,
      width: 400,
      height: 300,
      cellSize: 15,
      colorFunction: trianglify.colorFunctions.interpolateLinear(0.1)
    })
    addToPage(interpolate, 'trianglify.colorFunctions.interpolateLinear(0.1)')


    // Example 2: the shadows color function applies a faux-3d effect to the
    // pattern. This works best with subtle gradients and solid colors.
    const shadows = trianglify({
      seed,
      width: 400,
      height: 300,
      cellSize: 15,
      colorFunction: trianglify.colorFunctions.shadows()
    })
    addToPage(shadows, 'trianglify.colorFunctions.shadows()')

    // Example 4: you can write your own custom color function to have
    // total control over how the polygons are given color values.
    //
    // Here, we apply the xScale colors as a radial gradient:

    // define a custom color function that applies a radial gradient:
    const radialGradient = (radius) => ({centroid, xScale}) => {
      const distanceFromCenter = Math.sqrt(
        Math.pow(200 - centroid.x, 2) + Math.pow(150 - centroid.y, 2)
      )
      return(xScale(distanceFromCenter / radius))
    }
    // figure out the gradient radius required to cover the image dimensions:
    const gradientRadius = Math.sqrt(
      Math.pow(400 / 2, 2) + Math.pow(300 / 2, 2)
    )
    const radial = trianglify({
      seed,
      width: 400,
      height: 300,
      cellSize: 15,
      colorFunction: radialGradient(gradientRadius)
    })
    addToPage(radial, 'custom radial gradient')
  </script>
  </body>
</html>


================================================
FILE: examples/custom-points-example.html
================================================
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Trianglify custom points example</title>
    <style>
    html, body {
      margin: 0 0;
      padding: 0 0;
      text-align: center;
      font-size: 0;
    }
    </style>
  </head>
  <body>
  <script src="../dist/trianglify.bundle.debug.js"></script>
  <script>
  const width = 700
  const height = 700


  // generate a spiral using polar coordinates
  const points = []
  const NUM_POINTS = 150
  let r = 0
  const rStep = width / 2 / NUM_POINTS
  let theta = 0
  const thetaStep = Math.PI / NUM_POINTS * 18
  for (let i = 0; i < NUM_POINTS; i++) {
    const x = width / 2 + r * Math.cos(theta)
    const y = height / 2 + r * Math.sin(theta)
    const point = [x, y]
    points.push(point)
    r += rStep
    theta = (theta + thetaStep) % (2 * Math.PI)
  }


  // apply trianglify to convert the points to polygons and apply the color
  // gradient
  var pattern = trianglify({height, width, points})

  // use the toCanvas function to render the generated geometry to an HTML5
  // canvas element
  document.body.appendChild(pattern.toCanvas())
  </script>
  </body>
</html>


================================================
FILE: examples/destsvg-example.html
================================================
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Trianglify Basic Example</title>
    <style>
    html, body {
      margin: 0 0;
      padding: 0 0;
      text-align: center;
      font-size: 0;
      background: #000;
    }

    svg, canvas {
      padding-bottom: 30px;
      text-align: center;
    }
    </style>
  </head>
  <body>
  <svg id="svg-element" />
  <!-- This is the standalone build of Trianglify. It's easy to drop in to a
  project without any need for bundlers or dependency management, but in most
  modern web projects you will probably want to use the NPM module instead -->
  <script src="../dist/trianglify.bundle.debug.js"></script>
  <script>
    const pattern = trianglify({
      cellSize: 50,
      width: window.innerWidth * 0.8,
      height: (window.innerHeight - 4 * 30) / 4
    })

    const existingSVGElement = document.getElementById('svg-element')

    // Render to SVG
    pattern.toSVG(existingSVGElement)
  </script>
  </body>
</html>


================================================
FILE: examples/save-as-png.js
================================================
// Basic command-line example
// Usage: node save-as-png.js
var fs = require('fs')
var trianglify = require('../dist/trianglify.js')

// Generate a pattern and then grab the PNG data uri
const canvas = trianglify({
  width: 1920,
  height: 1080,
  cellSize: Math.random() * 200 + 40,
  xColors: 'random',
  variance: Math.random()
}).toCanvas()

// Save the buffer to a file. See the node-canvas docs for a full
// list of all the things you can do with this Canvas object:
// https://github.com/Automattic/node-canvas
const file = fs.createWriteStream('trianglify.png')
canvas.createPNGStream().pipe(file)


================================================
FILE: examples/save-as-svg.js
================================================
// Basic command-line example
// Usage: node save-as-svg.js
var fs = require('fs')
var trianglify = require('../dist/trianglify.js')

// Generate a pattern and render to an SVG node tree
const svg = trianglify({
  width: 1920,
  height: 1080,
  cellSize: Math.random() * 200 + 40,
  xColors: 'random',
  variance: Math.random()
}).toSVG()

// Save the string to a file
fs.writeFileSync('trianglify.svg', svg.toString())


================================================
FILE: examples/transparency-example.html
================================================
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Trianglify transparency example</title>
    <style>
    html, body {
      margin: 0 0;
      padding: 0 0;
      text-align: center;
      font-size: 0;
      height: 100%;
      width: 100%;
    }
    #gradient-rotate {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
    }
    #trianglify-overlay {
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
    }
    #color-stop-1 {
      -webkit-animation: change-color-1 12s ease-in-out infinite alternate;
      animation: change-color-1 12s ease-in-out infinite alternate
    }

    #color-stop-2 {
      -webkit-animation: change-color-2 12s ease-in-out infinite alternate;
      animation: change-color-2 12s ease-in-out infinite alternate
    }

    #color-stop-3 {
      -webkit-animation: change-color-3 12s ease-in-out infinite alternate;
      animation: change-color-3 12s ease-in-out infinite alternate
    }
    @keyframes change-color-1 {
      0% {
        stop-color: #22C8F6
      }

      25% {
        stop-color: #ff0
      }

      50% {
        stop-color: #00ffcb
      }

      75% {
        stop-color: #70ff00
      }
    }
    @keyframes change-color-2 {
      0% {
        stop-color: #20C498
      }

      25% {
        stop-color: #ff00ad
      }

      350% {
        stop-color: #d480ff
      }

      75% {
        stop-color: #ff9200
      }
    }
    @keyframes change-color-3 {
      0% {
        stop-color: #189932
      }

      25% {
        stop-color: #c300cb
      }

      50% {
        stop-color: #5600d4
      }

      75% {
        stop-color: #ff46dc
      }
    }
    </style>
  </head>
  <body>
  <svg id="gradient-rotate" preserveAspectRatio="none" viewBox="0 0 500 500">
    <defs>
      <linearGradient x1="0%" y1="0%" y2="100%" id="a">
        <stop id="color-stop-1" stop-color="#22C8F6" offset="0%"></stop>
        <stop id="color-stop-2" stop-color="#20C498" offset="65%"></stop>
        <stop id="color-stop-3" stop-color="#189932" offset="100%"></stop>
      </linearGradient>
    </defs>
    <path fill="url(#a)" d="M0 0h500v500H0z"></path>
  </svg>
  <script src="../dist/trianglify.bundle.debug.js"></script>
  <script>
  // set up the base pattern
  const pattern = trianglify({
    height: window.innerHeight,
    width: window.innerWidth,
    xColors: ['rgba(255, 255, 255, 0.1)', 'rgba(255, 255, 255, 1)'],
    yColors: 'match',
    cellSize: Math.ceil(window.innerWidth / 8)
  })
  var svg = pattern.toSVG()
  svg.id = 'trianglify-overlay'
  document.body.appendChild(svg)
  </script>
  </body>
</html>


================================================
FILE: package.json
================================================
{
  "name": "trianglify",
  "version": "4.1.1",
  "description": "Trianglify is a javascript library for generating colorful triangle meshes that can be used as SVG images and CSS backgrounds.",
  "main": "dist/trianglify.js",
  "scripts": {
    "lint": "standard",
    "test": "jest",
    "build": "rollup -c",
    "dev": "rollup -c -w",
    "publish-beta": "npm run build && npm publish --tag next",
    "ci": "npm run lint && npm run build && npm run test"
  },
  "dependencies": {
    "chroma-js": "^2.1.0",
    "delaunator": "^4.0.1",
    "canvas": "^2.6.1"
  },
  "directories": {
    "example": "examples"
  },
  "repository": {
    "type": "git",
    "url": "git://github.com/qrohlf/trianglify.git"
  },
  "keywords": [
    "svg",
    "canvas",
    "visualization",
    "pattern",
    "lowpoly"
  ],
  "standard": {
    "parser": "babel-eslint",
    "ignore": [
      "dist",
      "**/vendor/**"
    ]
  },
  "jest": {
    "setupFiles": [
      "jest-canvas-mock"
    ]
  },
  "author": "Quinn Rohlf <qr@qrohlf.com>",
  "license": "GPL-3.0",
  "bugs": {
    "url": "https://github.com/qrohlf/trianglify/issues"
  },
  "homepage": "https://github.com/qrohlf/trianglify",
  "devDependencies": {
    "@babel/plugin-proposal-class-properties": "^7.8.3",
    "@babel/plugin-syntax-class-properties": "^7.8.3",
    "@babel/preset-env": "^7.9.6",
    "@rollup/plugin-babel": "^5.0.0",
    "@rollup/plugin-commonjs": "^11.1.0",
    "@rollup/plugin-node-resolve": "^7.1.3",
    "babel-eslint": "^10.1.0",
    "jest": "^25.5.4",
    "jest-canvas-mock": "^2.2.0",
    "rollup": "^2.7.2",
    "rollup-plugin-bundle-size": "^1.0.3",
    "rollup-plugin-terser": "^5.3.0",
    "standard": "^14.3.3"
  }
}


================================================
FILE: rollup.config.js
================================================
import commonjs from '@rollup/plugin-commonjs'
import resolve from '@rollup/plugin-node-resolve'
import babel from '@rollup/plugin-babel'
import { terser } from 'rollup-plugin-terser'
import bundleSize from 'rollup-plugin-bundle-size'
import pkg from './package.json'

export default [
  { // build for node & module bundlers
    input: 'src/trianglify.js',
    external: ['chroma-js', 'delaunator', 'canvas'],
    plugins: [babel({ babelHelpers: 'bundled' }), bundleSize()],
    output: { file: pkg.main, format: 'cjs' }
  },
  {
    // build minified bundle to be used standalone for browser use
    // note: // chroma.js weighs 40k minified, a smaller solution would be nice
    input: 'src/trianglify.js',
    plugins: [terser({ output: { comments: false } }), resolve({ browser: true }), commonjs(), babel({ babelHelpers: 'bundled' }), bundleSize()],
    output: { file: 'dist/trianglify.bundle.js', format: 'umd', name: 'trianglify' }
  },
  {
    // build non-minified bundle to be used for debugging
    input: 'src/trianglify.js',
    plugins: [resolve({ browser: true }), commonjs(), babel({ babelHelpers: 'bundled' }), bundleSize()],
    output: { file: 'dist/trianglify.bundle.debug.js', format: 'umd', name: 'trianglify' }
  }
]


================================================
FILE: src/__snapshots__/trianglify.browser.test.js.snap
================================================
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Pattern generation should match snapshot for non-breaking version bumps 1`] = `
<svg
  height="400"
  width="600"
  xmlns="http://www.w3.org/2000/svg"
>
  <path
    d="M342.9,227.4L356,297.7L390.3,294.6Z"
    fill="rgb(230,107,18)"
    shape-rendering="crispEdges"
  />
  <path
    d="M390.3,294.6L396.5,178.3L342.9,227.4Z"
    fill="rgb(239,119,23)"
    shape-rendering="crispEdges"
  />
  <path
    d="M234.9,206.1L285,271.2L342.9,227.4Z"
    fill="rgb(248,143,37)"
    shape-rendering="crispEdges"
  />
  <path
    d="M342.9,227.4L285,271.2L356,297.7Z"
    fill="rgb(237,120,24)"
    shape-rendering="crispEdges"
  />
  <path
    d="M390.3,294.6L491.3,250.7L396.5,178.3Z"
    fill="rgb(227,104,16)"
    shape-rendering="crispEdges"
  />
  <path
    d="M270.7,350.3L316.2,368.3L356,297.7Z"
    fill="rgb(207,101,20)"
    shape-rendering="crispEdges"
  />
  <path
    d="M356,297.7L407.8,377.2L390.3,294.6Z"
    fill="rgb(206,86,10)"
    shape-rendering="crispEdges"
  />
  <path
    d="M390.3,294.6L505.4,325.1L491.3,250.7Z"
    fill="rgb(203,78,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M388.1,135.7L357.9,136.8L396.5,178.3Z"
    fill="rgb(245,154,50)"
    shape-rendering="crispEdges"
  />
  <path
    d="M396.5,178.3L357.9,136.8L342.9,227.4Z"
    fill="rgb(247,144,40)"
    shape-rendering="crispEdges"
  />
  <path
    d="M499.8,175.6L388.1,135.7L396.5,178.3Z"
    fill="rgb(235,137,40)"
    shape-rendering="crispEdges"
  />
  <path
    d="M316.2,368.3L407.8,377.2L356,297.7Z"
    fill="rgb(197,86,13)"
    shape-rendering="crispEdges"
  />
  <path
    d="M285,271.2L270.7,350.3L356,297.7Z"
    fill="rgb(225,113,21)"
    shape-rendering="crispEdges"
  />
  <path
    d="M259.2,131.7L234.9,206.1L342.9,227.4Z"
    fill="rgb(254,164,51)"
    shape-rendering="crispEdges"
  />
  <path
    d="M285,271.2L202,340.9L270.7,350.3Z"
    fill="rgb(219,124,35)"
    shape-rendering="crispEdges"
  />
  <path
    d="M407.8,377.2L505.4,325.1L390.3,294.6Z"
    fill="rgb(190,72,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M560.9,258.4L499.8,175.6L491.3,250.7Z"
    fill="rgb(200,92,16)"
    shape-rendering="crispEdges"
  />
  <path
    d="M491.3,250.7L499.8,175.6L396.5,178.3Z"
    fill="rgb(225,113,22)"
    shape-rendering="crispEdges"
  />
  <path
    d="M234.9,206.1L207.1,227.9L285,271.2Z"
    fill="rgb(249,156,49)"
    shape-rendering="crispEdges"
  />
  <path
    d="M344.6,57.3L259.2,131.7L357.9,136.8Z"
    fill="rgb(255,182,87)"
    shape-rendering="crispEdges"
  />
  <path
    d="M357.9,136.8L259.2,131.7L342.9,227.4Z"
    fill="rgb(252,163,52)"
    shape-rendering="crispEdges"
  />
  <path
    d="M234.9,206.1L196.4,142.7L207.1,227.9Z"
    fill="rgb(255,181,69)"
    shape-rendering="crispEdges"
  />
  <path
    d="M235,443.7L333.1,435.1L316.2,368.3Z"
    fill="rgb(175,94,24)"
    shape-rendering="crispEdges"
  />
  <path
    d="M316.2,368.3L333.1,435.1L407.8,377.2Z"
    fill="rgb(173,80,16)"
    shape-rendering="crispEdges"
  />
  <path
    d="M407.8,377.2L495.3,411.4L505.4,325.1Z"
    fill="rgb(160,57,5)"
    shape-rendering="crispEdges"
  />
  <path
    d="M333.1,435.1L438.6,425.2L407.8,377.2Z"
    fill="rgb(163,69,12)"
    shape-rendering="crispEdges"
  />
  <path
    d="M178.4,252.9L202,340.9L285,271.2Z"
    fill="rgb(235,143,46)"
    shape-rendering="crispEdges"
  />
  <path
    d="M270.7,350.3L235,443.7L316.2,368.3Z"
    fill="rgb(183,103,29)"
    shape-rendering="crispEdges"
  />
  <path
    d="M564.8,355.1L560.9,258.4L505.4,325.1Z"
    fill="rgb(165,59,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M505.4,325.1L560.9,258.4L491.3,250.7Z"
    fill="rgb(187,73,6)"
    shape-rendering="crispEdges"
  />
  <path
    d="M108.6,206.2L178.4,252.9L207.1,227.9Z"
    fill="rgb(252,176,83)"
    shape-rendering="crispEdges"
  />
  <path
    d="M207.1,227.9L178.4,252.9L285,271.2Z"
    fill="rgb(246,155,51)"
    shape-rendering="crispEdges"
  />
  <path
    d="M438.6,425.2L495.3,411.4L407.8,377.2Z"
    fill="rgb(152,57,7)"
    shape-rendering="crispEdges"
  />
  <path
    d="M407.6,22.7L344.6,57.3L388.1,135.7Z"
    fill="rgb(250,175,97)"
    shape-rendering="crispEdges"
  />
  <path
    d="M388.1,135.7L344.6,57.3L357.9,136.8Z"
    fill="rgb(250,171,80)"
    shape-rendering="crispEdges"
  />
  <path
    d="M201.9,26.9L196.4,142.7L259.2,131.7Z"
    fill="rgb(255,213,115)"
    shape-rendering="crispEdges"
  />
  <path
    d="M259.2,131.7L196.4,142.7L234.9,206.1Z"
    fill="rgb(254,190,74)"
    shape-rendering="crispEdges"
  />
  <path
    d="M580.8,103L506.2,98.2L499.8,175.6Z"
    fill="rgb(204,131,57)"
    shape-rendering="crispEdges"
  />
  <path
    d="M499.8,175.6L506.2,98.2L388.1,135.7Z"
    fill="rgb(227,139,52)"
    shape-rendering="crispEdges"
  />
  <path
    d="M134.1,328.3L209.2,402.4L202,340.9Z"
    fill="rgb(202,131,60)"
    shape-rendering="crispEdges"
  />
  <path
    d="M202,340.9L209.2,402.4L270.7,350.3Z"
    fill="rgb(196,120,40)"
    shape-rendering="crispEdges"
  />
  <path
    d="M495.3,411.4L564.8,355.1L505.4,325.1Z"
    fill="rgb(147,50,5)"
    shape-rendering="crispEdges"
  />
  <path
    d="M560.9,258.4L587.3,208.1L499.8,175.6Z"
    fill="rgb(191,94,19)"
    shape-rendering="crispEdges"
  />
  <path
    d="M651.7,272.4L587.3,208.1L560.9,258.4Z"
    fill="rgb(167,75,14)"
    shape-rendering="crispEdges"
  />
  <path
    d="M240.9,512.2L358.9,485.8L333.1,435.1Z"
    fill="rgb(174,90,22)"
    shape-rendering="crispEdges"
  />
  <path
    d="M333.1,435.1L358.9,485.8L438.6,425.2Z"
    fill="rgb(166,73,14)"
    shape-rendering="crispEdges"
  />
  <path
    d="M438.6,425.2L503.8,479.3L495.3,411.4Z"
    fill="rgb(142,51,6)"
    shape-rendering="crispEdges"
  />
  <path
    d="M209.2,402.4L235,443.7L270.7,350.3Z"
    fill="rgb(177,110,38)"
    shape-rendering="crispEdges"
  />
  <path
    d="M536.2,22.2L473.1,47.6L506.2,98.2Z"
    fill="rgb(217,151,93)"
    shape-rendering="crispEdges"
  />
  <path
    d="M506.2,98.2L473.1,47.6L388.1,135.7Z"
    fill="rgb(232,154,79)"
    shape-rendering="crispEdges"
  />
  <path
    d="M358.9,485.8L391.2,495.1L438.6,425.2Z"
    fill="rgb(162,68,12)"
    shape-rendering="crispEdges"
  />
  <path
    d="M473.1,47.6L407.6,22.7L388.1,135.7Z"
    fill="rgb(242,166,94)"
    shape-rendering="crispEdges"
  />
  <path
    d="M124.7,294.2L134.1,328.3L178.4,252.9Z"
    fill="rgb(237,157,80)"
    shape-rendering="crispEdges"
  />
  <path
    d="M178.4,252.9L134.1,328.3L202,340.9Z"
    fill="rgb(229,147,67)"
    shape-rendering="crispEdges"
  />
  <path
    d="M162.8,515.4L240.9,512.2L235,443.7Z"
    fill="rgb(177,116,46)"
    shape-rendering="crispEdges"
  />
  <path
    d="M495.3,411.4L566.2,407.4L564.8,355.1Z"
    fill="rgb(126,44,6)"
    shape-rendering="crispEdges"
  />
  <path
    d="M564.8,355.1L651.7,272.4L560.9,258.4Z"
    fill="rgb(155,58,7)"
    shape-rendering="crispEdges"
  />
  <path
    d="M503.8,479.3L566.2,407.4L495.3,411.4Z"
    fill="rgb(128,45,6)"
    shape-rendering="crispEdges"
  />
  <path
    d="M108.6,206.2L124.7,294.2L178.4,252.9Z"
    fill="rgb(250,172,89)"
    shape-rendering="crispEdges"
  />
  <path
    d="M344.6,57.3L273.5,26.7L259.2,131.7Z"
    fill="rgb(255,198,110)"
    shape-rendering="crispEdges"
  />
  <path
    d="M273,-16.7L273.5,26.7L336.7,-43.1Z"
    fill="rgb(255,205,139)"
    shape-rendering="crispEdges"
  />
  <path
    d="M391.2,495.1L503.8,479.3L438.6,425.2Z"
    fill="rgb(152,57,7)"
    shape-rendering="crispEdges"
  />
  <path
    d="M587.3,208.1L580.8,103L499.8,175.6Z"
    fill="rgb(192,115,36)"
    shape-rendering="crispEdges"
  />
  <path
    d="M139.1,109.6L108.6,206.2L196.4,142.7Z"
    fill="rgb(255,211,112)"
    shape-rendering="crispEdges"
  />
  <path
    d="M196.4,142.7L108.6,206.2L207.1,227.9Z"
    fill="rgb(255,189,89)"
    shape-rendering="crispEdges"
  />
  <path
    d="M201.9,26.9L139.1,109.6L196.4,142.7Z"
    fill="rgb(255,222,136)"
    shape-rendering="crispEdges"
  />
  <path
    d="M654.3,350.8L651.7,272.4L564.8,355.1Z"
    fill="rgb(139,50,6)"
    shape-rendering="crispEdges"
  />
  <path
    d="M587.3,208.1L630.4,103.1L580.8,103Z"
    fill="rgb(177,117,48)"
    shape-rendering="crispEdges"
  />
  <path
    d="M162.8,515.4L235,443.7L209.2,402.4Z"
    fill="rgb(177,118,50)"
    shape-rendering="crispEdges"
  />
  <path
    d="M235,443.7L240.9,512.2L333.1,435.1Z"
    fill="rgb(176,101,30)"
    shape-rendering="crispEdges"
  />
  <path
    d="M358.9,485.8L240.9,512.2L391.2,495.1Z"
    fill="rgb(172,85,19)"
    shape-rendering="crispEdges"
  />
  <path
    d="M273,-16.7L201.9,26.9L273.5,26.7Z"
    fill="rgb(255,217,145)"
    shape-rendering="crispEdges"
  />
  <path
    d="M273.5,26.7L201.9,26.9L259.2,131.7Z"
    fill="rgb(255,213,125)"
    shape-rendering="crispEdges"
  />
  <path
    d="M638.2,509.9L620.1,400.3L566.2,407.4Z"
    fill="rgb(102,37,6)"
    shape-rendering="crispEdges"
  />
  <path
    d="M566.2,407.4L620.1,400.3L564.8,355.1Z"
    fill="rgb(114,40,6)"
    shape-rendering="crispEdges"
  />
  <path
    d="M514.5,-43.8L386.6,-31L407.6,22.7Z"
    fill="rgb(243,170,120)"
    shape-rendering="crispEdges"
  />
  <path
    d="M580.8,103L536.2,22.2L506.2,98.2Z"
    fill="rgb(203,142,83)"
    shape-rendering="crispEdges"
  />
  <path
    d="M514.5,-43.8L407.6,22.7L473.1,47.6Z"
    fill="rgb(234,163,114)"
    shape-rendering="crispEdges"
  />
  <path
    d="M407.6,22.7L386.6,-31L344.6,57.3Z"
    fill="rgb(254,182,120)"
    shape-rendering="crispEdges"
  />
  <path
    d="M336.7,-43.1L273.5,26.7L344.6,57.3Z"
    fill="rgb(255,198,130)"
    shape-rendering="crispEdges"
  />
  <path
    d="M651.7,272.4L663.5,223.8L587.3,208.1Z"
    fill="rgb(169,79,17)"
    shape-rendering="crispEdges"
  />
  <path
    d="M580.8,103L609.7,27.6L536.2,22.2Z"
    fill="rgb(190,141,92)"
    shape-rendering="crispEdges"
  />
  <path
    d="M620.1,400.3L654.3,350.8L564.8,355.1Z"
    fill="rgb(118,42,6)"
    shape-rendering="crispEdges"
  />
  <path
    d="M726.1,259.6L686.3,206L663.5,223.8Z"
    fill="rgb(170,81,18)"
    shape-rendering="crispEdges"
  />
  <path
    d="M663.5,223.8L630.4,103.1L587.3,208.1Z"
    fill="rgb(176,102,31)"
    shape-rendering="crispEdges"
  />
  <path
    d="M386.6,-31L336.7,-43.1L344.6,57.3Z"
    fill="rgb(255,189,130)"
    shape-rendering="crispEdges"
  />
  <path
    d="M124.7,294.2L54.7,300.1L134.1,328.3Z"
    fill="rgb(232,157,89)"
    shape-rendering="crispEdges"
  />
  <path
    d="M134.1,328.3L89.3,429.4L209.2,402.4Z"
    fill="rgb(186,132,74)"
    shape-rendering="crispEdges"
  />
  <path
    d="M108.6,206.2L54.7,300.1L124.7,294.2Z"
    fill="rgb(247,172,98)"
    shape-rendering="crispEdges"
  />
  <path
    d="M11.8,176.7L54.7,300.1L108.6,206.2Z"
    fill="rgb(255,190,116)"
    shape-rendering="crispEdges"
  />
  <path
    d="M726.1,259.6L663.5,223.8L651.7,272.4Z"
    fill="rgb(166,72,13)"
    shape-rendering="crispEdges"
  />
  <path
    d="M663.5,223.8L686.3,206L630.4,103.1Z"
    fill="rgb(176,102,31)"
    shape-rendering="crispEdges"
  />
  <path
    d="M391.2,495.1L564.2,521.7L503.8,479.3Z"
    fill="rgb(139,50,6)"
    shape-rendering="crispEdges"
  />
  <path
    d="M503.8,479.3L564.2,521.7L566.2,407.4Z"
    fill="rgb(120,43,6)"
    shape-rendering="crispEdges"
  />
  <path
    d="M702,425.1L689.2,351.7L654.3,350.8Z"
    fill="rgb(114,41,6)"
    shape-rendering="crispEdges"
  />
  <path
    d="M240.9,512.2L564.2,521.7L391.2,495.1Z"
    fill="rgb(162,68,11)"
    shape-rendering="crispEdges"
  />
  <path
    d="M54.7,300.1L89.3,429.4L134.1,328.3Z"
    fill="rgb(208,146,89)"
    shape-rendering="crispEdges"
  />
  <path
    d="M89.3,429.4L162.8,515.4L209.2,402.4Z"
    fill="rgb(178,127,70)"
    shape-rendering="crispEdges"
  />
  <path
    d="M240.9,512.2L111.9,519.8L564.2,521.7Z"
    fill="rgb(174,91,22)"
    shape-rendering="crispEdges"
  />
  <path
    d="M702,425.1L654.3,350.8L620.1,400.3Z"
    fill="rgb(106,38,6)"
    shape-rendering="crispEdges"
  />
  <path
    d="M654.3,350.8L689.2,351.7L651.7,272.4Z"
    fill="rgb(139,50,6)"
    shape-rendering="crispEdges"
  />
  <path
    d="M201.9,26.9L106.2,41.2L139.1,109.6Z"
    fill="rgb(255,235,163)"
    shape-rendering="crispEdges"
  />
  <path
    d="M18.5,119.3L11.8,176.7L108.6,206.2Z"
    fill="rgb(255,215,137)"
    shape-rendering="crispEdges"
  />
  <path
    d="M241.2,-79.6L164.3,-3.1L201.9,26.9Z"
    fill="rgb(255,230,165)"
    shape-rendering="crispEdges"
  />
  <path
    d="M241.2,-79.6L201.9,26.9L273,-16.7Z"
    fill="rgb(255,221,152)"
    shape-rendering="crispEdges"
  />
  <path
    d="M705,57.6L609.7,27.6L630.4,103.1Z"
    fill="rgb(180,135,86)"
    shape-rendering="crispEdges"
  />
  <path
    d="M630.4,103.1L609.7,27.6L580.8,103Z"
    fill="rgb(179,132,80)"
    shape-rendering="crispEdges"
  />
  <path
    d="M536.2,22.2L514.5,-43.8L473.1,47.6Z"
    fill="rgb(219,155,111)"
    shape-rendering="crispEdges"
  />
  <path
    d="M570,-27.1L514.5,-43.8L536.2,22.2Z"
    fill="rgb(207,150,113)"
    shape-rendering="crispEdges"
  />
  <path
    d="M439.5,-114.5L311.2,-75.7L336.7,-43.1Z"
    fill="rgb(255,187,129)"
    shape-rendering="crispEdges"
  />
  <path
    d="M439.5,-114.5L336.7,-43.1L386.6,-31Z"
    fill="rgb(253,181,126)"
    shape-rendering="crispEdges"
  />
  <path
    d="M336.7,-43.1L311.2,-75.7L273,-16.7Z"
    fill="rgb(255,202,137)"
    shape-rendering="crispEdges"
  />
  <path
    d="M164.3,-3.1L106.2,41.2L201.9,26.9Z"
    fill="rgb(255,238,175)"
    shape-rendering="crispEdges"
  />
  <path
    d="M686.3,206L686.9,119.5L630.4,103.1Z"
    fill="rgb(177,116,45)"
    shape-rendering="crispEdges"
  />
  <path
    d="M726.1,259.6L686.9,119.5L686.3,206Z"
    fill="rgb(175,95,25)"
    shape-rendering="crispEdges"
  />
  <path
    d="M609.7,27.6L570,-27.1L536.2,22.2Z"
    fill="rgb(194,145,109)"
    shape-rendering="crispEdges"
  />
  <path
    d="M642.4,-47.5L570,-27.1L609.7,27.6Z"
    fill="rgb(183,141,110)"
    shape-rendering="crispEdges"
  />
  <path
    d="M689.2,351.7L726.1,259.6L651.7,272.4Z"
    fill="rgb(153,58,7)"
    shape-rendering="crispEdges"
  />
  <path
    d="M311.2,-75.7L241.2,-79.6L273,-16.7Z"
    fill="rgb(255,211,144)"
    shape-rendering="crispEdges"
  />
  <path
    d="M164.3,-3.1L139.9,-29.7L106.2,41.2Z"
    fill="rgb(255,242,190)"
    shape-rendering="crispEdges"
  />
  <path
    d="M47.6,452.4L111.9,519.8L89.3,429.4Z"
    fill="rgb(180,136,89)"
    shape-rendering="crispEdges"
  />
  <path
    d="M89.3,429.4L111.9,519.8L162.8,515.4Z"
    fill="rgb(179,132,79)"
    shape-rendering="crispEdges"
  />
  <path
    d="M162.8,515.4L111.9,519.8L240.9,512.2Z"
    fill="rgb(178,124,63)"
    shape-rendering="crispEdges"
  />
  <path
    d="M18.5,119.3L108.6,206.2L139.1,109.6Z"
    fill="rgb(255,221,134)"
    shape-rendering="crispEdges"
  />
  <path
    d="M54.7,300.1L9.7,344.5L89.3,429.4Z"
    fill="rgb(206,148,100)"
    shape-rendering="crispEdges"
  />
  <path
    d="M564.2,521.7L638.2,509.9L566.2,407.4Z"
    fill="rgb(105,38,6)"
    shape-rendering="crispEdges"
  />
  <path
    d="M689.2,351.7L702,425.1L726.1,259.6Z"
    fill="rgb(129,46,6)"
    shape-rendering="crispEdges"
  />
  <path
    d="M241.2,-79.6L139.9,-29.7L164.3,-3.1Z"
    fill="rgb(255,234,174)"
    shape-rendering="crispEdges"
  />
  <path
    d="M45.4,57.6L18.5,119.3L139.1,109.6Z"
    fill="rgb(255,238,170)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-9.7,287.1L9.7,344.5L54.7,300.1Z"
    fill="rgb(234,163,112)"
    shape-rendering="crispEdges"
  />
  <path
    d="M638.2,509.9L702,425.1L620.1,400.3Z"
    fill="rgb(102,37,6)"
    shape-rendering="crispEdges"
  />
  <path
    d="M9.7,344.5L47.6,452.4L89.3,429.4Z"
    fill="rgb(181,139,98)"
    shape-rendering="crispEdges"
  />
  <path
    d="M45.4,57.6L139.1,109.6L106.2,41.2Z"
    fill="rgb(255,240,173)"
    shape-rendering="crispEdges"
  />
  <path
    d="M513.2,-124.5L439.5,-114.5L514.5,-43.8Z"
    fill="rgb(226,159,116)"
    shape-rendering="crispEdges"
  />
  <path
    d="M514.5,-43.8L439.5,-114.5L386.6,-31Z"
    fill="rgb(241,167,119)"
    shape-rendering="crispEdges"
  />
  <path
    d="M311.2,-75.7L178,-113.2L241.2,-79.6Z"
    fill="rgb(255,220,151)"
    shape-rendering="crispEdges"
  />
  <path
    d="M11.8,176.7L-9.7,287.1L54.7,300.1Z"
    fill="rgb(253,182,121)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-45.6,183.3L-9.7,287.1L11.8,176.7Z"
    fill="rgb(255,198,135)"
    shape-rendering="crispEdges"
  />
  <path
    d="M18,-13.9L45.4,57.6L106.2,41.2Z"
    fill="rgb(255,250,202)"
    shape-rendering="crispEdges"
  />
  <path
    d="M726.1,259.6L705,57.6L686.9,119.5Z"
    fill="rgb(176,115,44)"
    shape-rendering="crispEdges"
  />
  <path
    d="M686.9,119.5L705,57.6L630.4,103.1Z"
    fill="rgb(179,129,74)"
    shape-rendering="crispEdges"
  />
  <path
    d="M536.4,-126.6L513.2,-124.5L514.5,-43.8Z"
    fill="rgb(214,153,113)"
    shape-rendering="crispEdges"
  />
  <path
    d="M536.4,-126.6L514.5,-43.8L570,-27.1Z"
    fill="rgb(207,150,113)"
    shape-rendering="crispEdges"
  />
  <path
    d="M688.9,-34L642.4,-47.5L609.7,27.6Z"
    fill="rgb(183,141,110)"
    shape-rendering="crispEdges"
  />
  <path
    d="M241.2,-79.6L178,-113.2L139.9,-29.7Z"
    fill="rgb(255,233,172)"
    shape-rendering="crispEdges"
  />
  <path
    d="M139.9,-29.7L18,-13.9L106.2,41.2Z"
    fill="rgb(255,249,205)"
    shape-rendering="crispEdges"
  />
  <path
    d="M439.5,-114.5L178,-113.2L311.2,-75.7Z"
    fill="rgb(255,201,137)"
    shape-rendering="crispEdges"
  />
  <path
    d="M131,-124.4L178,-113.2L439.5,-114.5Z"
    fill="rgb(255,218,150)"
    shape-rendering="crispEdges"
  />
  <path
    d="M657.2,-85.5L536.4,-126.6L570,-27.1Z"
    fill="rgb(188,143,111)"
    shape-rendering="crispEdges"
  />
  <path
    d="M513.2,-124.5L131,-124.4L439.5,-114.5Z"
    fill="rgb(255,188,129)"
    shape-rendering="crispEdges"
  />
  <path
    d="M638.2,509.9L725.2,482.4L702,425.1Z"
    fill="rgb(102,37,6)"
    shape-rendering="crispEdges"
  />
  <path
    d="M702,425.1L725.2,482.4L726.1,259.6Z"
    fill="rgb(107,39,6)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-62.5,104.1L-45.6,183.3L18.5,119.3Z"
    fill="rgb(255,230,165)"
    shape-rendering="crispEdges"
  />
  <path
    d="M18.5,119.3L-45.6,183.3L11.8,176.7Z"
    fill="rgb(255,221,152)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-62.4,329L-33.1,415.8L9.7,344.5Z"
    fill="rgb(205,149,112)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-62.4,329L9.7,344.5L-9.7,287.1Z"
    fill="rgb(229,161,116)"
    shape-rendering="crispEdges"
  />
  <path
    d="M9.7,344.5L-33.1,415.8L47.6,452.4Z"
    fill="rgb(182,140,108)"
    shape-rendering="crispEdges"
  />
  <path
    d="M47.6,452.4L22.8,527.3L111.9,519.8Z"
    fill="rgb(181,138,95)"
    shape-rendering="crispEdges"
  />
  <path
    d="M705,57.6L688.9,-34L609.7,27.6Z"
    fill="rgb(182,140,104)"
    shape-rendering="crispEdges"
  />
  <path
    d="M642.4,-47.5L657.2,-85.5L570,-27.1Z"
    fill="rgb(183,141,110)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-92.6,283L-62.4,329L-9.7,287.1Z"
    fill="rgb(241,167,118)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-41.6,508.7L22.8,527.3L47.6,452.4Z"
    fill="rgb(182,140,108)"
    shape-rendering="crispEdges"
  />
  <path
    d="M111.9,519.8L22.8,527.3L564.2,521.7Z"
    fill="rgb(176,111,39)"
    shape-rendering="crispEdges"
  />
  <path
    d="M39,-89.3L18,-13.9L139.9,-29.7Z"
    fill="rgb(255,251,211)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-51.2,56.1L-62.5,104.1L18.5,119.3Z"
    fill="rgb(255,242,190)"
    shape-rendering="crispEdges"
  />
  <path
    d="M688.9,-34L657.2,-85.5L642.4,-47.5Z"
    fill="rgb(183,141,110)"
    shape-rendering="crispEdges"
  />
  <path
    d="M536.4,-126.6L131,-124.4L513.2,-124.5Z"
    fill="rgb(252,180,125)"
    shape-rendering="crispEdges"
  />
  <path
    d="M178,-113.2L131,-124.4L139.9,-29.7Z"
    fill="rgb(255,241,187)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-51.2,56.1L18.5,119.3L45.4,57.6Z"
    fill="rgb(255,245,195)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-45.6,183.3L-92.6,283L-9.7,287.1Z"
    fill="rgb(255,184,127)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-89.1,432L-41.6,508.7L-33.1,415.8Z"
    fill="rgb(183,141,110)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-103.5,176L-92.6,283L-45.6,183.3Z"
    fill="rgb(255,198,135)"
    shape-rendering="crispEdges"
  />
  <path
    d="M18,-13.9L-51.2,56.1L45.4,57.6Z"
    fill="rgb(255,252,214)"
    shape-rendering="crispEdges"
  />
  <path
    d="M131,-124.4L39,-89.3L139.9,-29.7Z"
    fill="rgb(255,247,200)"
    shape-rendering="crispEdges"
  />
  <path
    d="M18,-13.9L-27.6,-18L-51.2,56.1Z"
    fill="rgb(255,254,226)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-123.3,147.5L-103.5,176L-62.5,104.1Z"
    fill="rgb(255,227,160)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-62.5,104.1L-103.5,176L-45.6,183.3Z"
    fill="rgb(255,223,154)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-33.1,415.8L-41.6,508.7L47.6,452.4Z"
    fill="rgb(183,141,110)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-89.1,432L-33.1,415.8L-62.4,329Z"
    fill="rgb(187,143,111)"
    shape-rendering="crispEdges"
  />
  <path
    d="M39,-89.3L-27.6,-18L18,-13.9Z"
    fill="rgb(255,254,226)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-118.4,41.5L-123.3,147.5L-62.5,104.1Z"
    fill="rgb(255,241,188)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-133.7,335.4L-62.4,329L-92.6,283Z"
    fill="rgb(232,162,117)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-133.7,335.4L-89.1,432L-62.4,329Z"
    fill="rgb(203,149,112)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-118.4,41.5L-62.5,104.1L-51.2,56.1Z"
    fill="rgb(255,247,201)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-103.5,176L-133.7,335.4L-92.6,283Z"
    fill="rgb(251,179,125)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-123.3,147.5L-133.7,335.4L-103.5,176Z"
    fill="rgb(255,196,134)"
    shape-rendering="crispEdges"
  />
  <path
    d="M705,57.6L708.8,-126.1L688.9,-34Z"
    fill="rgb(183,141,110)"
    shape-rendering="crispEdges"
  />
  <path
    d="M688.9,-34L708.8,-126.1L657.2,-85.5Z"
    fill="rgb(183,141,110)"
    shape-rendering="crispEdges"
  />
  <path
    d="M657.2,-85.5L708.8,-126.1L536.4,-126.6Z"
    fill="rgb(183,141,110)"
    shape-rendering="crispEdges"
  />
  <path
    d="M726.1,259.6L708.8,-126.1L705,57.6Z"
    fill="rgb(180,135,86)"
    shape-rendering="crispEdges"
  />
  <path
    d="M39,-89.3L-16.6,-108.5L-27.6,-18Z"
    fill="rgb(255,255,229)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-115.8,-25.3L-118.4,41.5L-51.2,56.1Z"
    fill="rgb(255,253,219)"
    shape-rendering="crispEdges"
  />
  <path
    d="M131,-124.4L-16.6,-108.5L39,-89.3Z"
    fill="rgb(255,252,215)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-115.8,-25.3L-51.2,56.1L-27.6,-18Z"
    fill="rgb(255,255,227)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-123.3,147.5L-115.8,-25.3L-133.7,335.4Z"
    fill="rgb(255,224,155)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-133.7,335.4L-115.1,485.4L-89.1,432Z"
    fill="rgb(183,141,110)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-89.1,432L-115.1,485.4L-41.6,508.7Z"
    fill="rgb(183,141,110)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-109,-104.7L-115.8,-25.3L-27.6,-18Z"
    fill="rgb(255,255,229)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-118.4,41.5L-115.8,-25.3L-123.3,147.5Z"
    fill="rgb(255,250,207)"
    shape-rendering="crispEdges"
  />
  <path
    d="M131,-124.4L-109,-104.7L-16.6,-108.5Z"
    fill="rgb(255,255,228)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-16.6,-108.5L-109,-104.7L-27.6,-18Z"
    fill="rgb(255,255,229)"
    shape-rendering="crispEdges"
  />
</svg>
`;

exports[`Pattern outputs in browser environment #toSVG supports rendering to the destSVG target 1`] = `
<svg
  height="400"
  width="600"
  xmlns="http://www.w3.org/2000/svg"
>
  <path
    d="M271.8,183.1L241.1,145.4L169.5,190.6Z"
    fill="rgb(253,166,96)"
    shape-rendering="crispEdges"
  />
  <path
    d="M169.5,190.6L240.6,249.3L271.8,183.1Z"
    fill="rgb(253,155,81)"
    shape-rendering="crispEdges"
  />
  <path
    d="M241.1,145.4L209.1,116.4L169.5,190.6Z"
    fill="rgb(253,178,113)"
    shape-rendering="crispEdges"
  />
  <path
    d="M169.5,190.6L183.4,264.3L240.6,249.3Z"
    fill="rgb(251,152,82)"
    shape-rendering="crispEdges"
  />
  <path
    d="M337.8,257.9L326.2,179.1L271.8,183.1Z"
    fill="rgb(251,136,55)"
    shape-rendering="crispEdges"
  />
  <path
    d="M271.8,183.1L345.4,136L241.1,145.4Z"
    fill="rgb(254,159,86)"
    shape-rendering="crispEdges"
  />
  <path
    d="M255,28.1L204.5,67.8L209.1,116.4Z"
    fill="rgb(255,198,148)"
    shape-rendering="crispEdges"
  />
  <path
    d="M209.1,116.4L126.4,144.1L169.5,190.6Z"
    fill="rgb(254,187,128)"
    shape-rendering="crispEdges"
  />
  <path
    d="M169.5,190.6L110.3,205.9L183.4,264.3Z"
    fill="rgb(254,167,103)"
    shape-rendering="crispEdges"
  />
  <path
    d="M126.4,144.1L110.3,205.9L169.5,190.6Z"
    fill="rgb(255,183,125)"
    shape-rendering="crispEdges"
  />
  <path
    d="M255,28.1L209.1,116.4L241.1,145.4Z"
    fill="rgb(254,190,133)"
    shape-rendering="crispEdges"
  />
  <path
    d="M209.1,116.4L204.5,67.8L126.4,144.1Z"
    fill="rgb(254,198,146)"
    shape-rendering="crispEdges"
  />
  <path
    d="M279,335.3L337.8,257.9L240.6,249.3Z"
    fill="rgb(240,117,42)"
    shape-rendering="crispEdges"
  />
  <path
    d="M240.6,249.3L337.8,257.9L271.8,183.1Z"
    fill="rgb(250,134,55)"
    shape-rendering="crispEdges"
  />
  <path
    d="M414.9,178.7L345.4,136L326.2,179.1Z"
    fill="rgb(249,139,63)"
    shape-rendering="crispEdges"
  />
  <path
    d="M326.2,179.1L345.4,136L271.8,183.1Z"
    fill="rgb(253,149,73)"
    shape-rendering="crispEdges"
  />
  <path
    d="M110.3,205.9L104.2,278.7L183.4,264.3Z"
    fill="rgb(253,161,100)"
    shape-rendering="crispEdges"
  />
  <path
    d="M183.4,264.3L279,335.3L240.6,249.3Z"
    fill="rgb(241,128,59)"
    shape-rendering="crispEdges"
  />
  <path
    d="M167.5,358L279,335.3L183.4,264.3Z"
    fill="rgb(228,125,64)"
    shape-rendering="crispEdges"
  />
  <path
    d="M43.8,141.2L63.8,217.6L110.3,205.9Z"
    fill="rgb(255,190,139)"
    shape-rendering="crispEdges"
  />
  <path
    d="M110.3,205.9L63.8,217.6L104.2,278.7Z"
    fill="rgb(255,172,116)"
    shape-rendering="crispEdges"
  />
  <path
    d="M342.8,66.2L255,28.1L241.1,145.4Z"
    fill="rgb(255,184,127)"
    shape-rendering="crispEdges"
  />
  <path
    d="M104.2,278.7L167.5,358L183.4,264.3Z"
    fill="rgb(240,143,86)"
    shape-rendering="crispEdges"
  />
  <path
    d="M345.4,136L342.8,66.2L241.1,145.4Z"
    fill="rgb(255,167,101)"
    shape-rendering="crispEdges"
  />
  <path
    d="M97.6,55.4L43.8,141.2L126.4,144.1Z"
    fill="rgb(255,212,172)"
    shape-rendering="crispEdges"
  />
  <path
    d="M126.4,144.1L43.8,141.2L110.3,205.9Z"
    fill="rgb(255,195,144)"
    shape-rendering="crispEdges"
  />
  <path
    d="M97.6,55.4L126.4,144.1L204.5,67.8Z"
    fill="rgb(253,211,169)"
    shape-rendering="crispEdges"
  />
  <path
    d="M180.5,-3.4L97.6,55.4L204.5,67.8Z"
    fill="rgb(255,218,183)"
    shape-rendering="crispEdges"
  />
  <path
    d="M439.7,261.8L414.9,178.7L337.8,257.9Z"
    fill="rgb(240,107,25)"
    shape-rendering="crispEdges"
  />
  <path
    d="M337.8,257.9L414.9,178.7L326.2,179.1Z"
    fill="rgb(248,125,43)"
    shape-rendering="crispEdges"
  />
  <path
    d="M345.4,136L409.6,105L342.8,66.2Z"
    fill="rgb(252,159,95)"
    shape-rendering="crispEdges"
  />
  <path
    d="M255,28.1L180.5,-3.4L204.5,67.8Z"
    fill="rgb(255,207,166)"
    shape-rendering="crispEdges"
  />
  <path
    d="M342.8,66.2L262.8,-4.9L255,28.1Z"
    fill="rgb(255,192,143)"
    shape-rendering="crispEdges"
  />
  <path
    d="M255,28.1L262.8,-4.9L180.5,-3.4Z"
    fill="rgb(255,207,166)"
    shape-rendering="crispEdges"
  />
  <path
    d="M414.9,178.7L409.6,105L345.4,136Z"
    fill="rgb(247,141,71)"
    shape-rendering="crispEdges"
  />
  <path
    d="M342.8,66.2L347.7,-31.8L262.8,-4.9Z"
    fill="rgb(255,188,140)"
    shape-rendering="crispEdges"
  />
  <path
    d="M98.3,373.8L181.5,397.3L167.5,358Z"
    fill="rgb(202,127,82)"
    shape-rendering="crispEdges"
  />
  <path
    d="M167.5,358L264.1,402.7L279,335.3Z"
    fill="rgb(204,109,52)"
    shape-rendering="crispEdges"
  />
  <path
    d="M98.3,373.8L167.5,358L104.2,278.7Z"
    fill="rgb(222,138,91)"
    shape-rendering="crispEdges"
  />
  <path
    d="M264.1,402.7L359,353.3L279,335.3Z"
    fill="rgb(203,95,32)"
    shape-rendering="crispEdges"
  />
  <path
    d="M279,335.3L359,353.3L337.8,257.9Z"
    fill="rgb(225,99,26)"
    shape-rendering="crispEdges"
  />
  <path
    d="M181.5,397.3L264.1,402.7L167.5,358Z"
    fill="rgb(196,113,62)"
    shape-rendering="crispEdges"
  />
  <path
    d="M409.6,105L385.1,50.1L342.8,66.2Z"
    fill="rgb(253,163,105)"
    shape-rendering="crispEdges"
  />
  <path
    d="M15.9,285.3L104.2,278.7L63.8,217.6Z"
    fill="rgb(254,167,117)"
    shape-rendering="crispEdges"
  />
  <path
    d="M30.6,329.6L98.3,373.8L104.2,278.7Z"
    fill="rgb(229,147,105)"
    shape-rendering="crispEdges"
  />
  <path
    d="M180.5,-3.4L139.8,-13L97.6,55.4Z"
    fill="rgb(255,226,198)"
    shape-rendering="crispEdges"
  />
  <path
    d="M97.6,55.4L11.8,55L43.8,141.2Z"
    fill="rgb(254,225,196)"
    shape-rendering="crispEdges"
  />
  <path
    d="M134.1,-95.9L139.8,-13L180.5,-3.4Z"
    fill="rgb(255,226,198)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-12.5,248.2L15.9,285.3L63.8,217.6Z"
    fill="rgb(255,174,126)"
    shape-rendering="crispEdges"
  />
  <path
    d="M429.7,337L439.7,261.8L337.8,257.9Z"
    fill="rgb(228,88,9)"
    shape-rendering="crispEdges"
  />
  <path
    d="M414.9,178.7L477.2,99.5L409.6,105Z"
    fill="rgb(241,137,73)"
    shape-rendering="crispEdges"
  />
  <path
    d="M15.9,285.3L30.6,329.6L104.2,278.7Z"
    fill="rgb(246,157,113)"
    shape-rendering="crispEdges"
  />
  <path
    d="M439.7,261.8L460.9,188.3L414.9,178.7Z"
    fill="rgb(236,107,31)"
    shape-rendering="crispEdges"
  />
  <path
    d="M409.6,105L489,56.6L385.1,50.1Z"
    fill="rgb(246,154,101)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-41.8,193.3L-12.5,248.2L63.8,217.6Z"
    fill="rgb(255,186,140)"
    shape-rendering="crispEdges"
  />
  <path
    d="M15.9,285.3L-45.4,355L30.6,329.6Z"
    fill="rgb(235,156,119)"
    shape-rendering="crispEdges"
  />
  <path
    d="M48.8,-40L11.8,55L97.6,55.4Z"
    fill="rgb(255,236,218)"
    shape-rendering="crispEdges"
  />
  <path
    d="M43.8,141.2L-41.8,193.3L63.8,217.6Z"
    fill="rgb(255,196,150)"
    shape-rendering="crispEdges"
  />
  <path
    d="M359,353.3L429.7,337L337.8,257.9Z"
    fill="rgb(221,86,10)"
    shape-rendering="crispEdges"
  />
  <path
    d="M439.7,261.8L480.7,296.8L460.9,188.3Z"
    fill="rgb(225,88,10)"
    shape-rendering="crispEdges"
  />
  <path
    d="M398.9,441.1L429.7,337L359,353.3Z"
    fill="rgb(189,70,8)"
    shape-rendering="crispEdges"
  />
  <path
    d="M385.1,50.1L347.7,-31.8L342.8,66.2Z"
    fill="rgb(255,176,126)"
    shape-rendering="crispEdges"
  />
  <path
    d="M183.9,-113.5L134.1,-95.9L180.5,-3.4Z"
    fill="rgb(255,223,192)"
    shape-rendering="crispEdges"
  />
  <path
    d="M440.3,-36.4L347.7,-31.8L385.1,50.1Z"
    fill="rgb(255,173,128)"
    shape-rendering="crispEdges"
  />
  <path
    d="M274.4,510.6L319.3,434.5L264.1,402.7Z"
    fill="rgb(189,92,36)"
    shape-rendering="crispEdges"
  />
  <path
    d="M264.1,402.7L319.3,434.5L359,353.3Z"
    fill="rgb(189,86,28)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-51.2,142.1L-41.8,193.3L43.8,141.2Z"
    fill="rgb(255,206,166)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-45.4,355L33.1,424.7L30.6,329.6Z"
    fill="rgb(211,145,114)"
    shape-rendering="crispEdges"
  />
  <path
    d="M460.9,188.3L477.2,99.5L414.9,178.7Z"
    fill="rgb(237,123,56)"
    shape-rendering="crispEdges"
  />
  <path
    d="M33.1,424.7L119.3,448.5L98.3,373.8Z"
    fill="rgb(195,131,98)"
    shape-rendering="crispEdges"
  />
  <path
    d="M98.3,373.8L119.3,448.5L181.5,397.3Z"
    fill="rgb(193,124,85)"
    shape-rendering="crispEdges"
  />
  <path
    d="M181.5,397.3L198.6,477.3L264.1,402.7Z"
    fill="rgb(190,108,58)"
    shape-rendering="crispEdges"
  />
  <path
    d="M11.8,55L-51.2,142.1L43.8,141.2Z"
    fill="rgb(255,222,191)"
    shape-rendering="crispEdges"
  />
  <path
    d="M475.3,347.4L480.7,296.8L429.7,337Z"
    fill="rgb(199,66,2)"
    shape-rendering="crispEdges"
  />
  <path
    d="M429.7,337L480.7,296.8L439.7,261.8Z"
    fill="rgb(217,73,1)"
    shape-rendering="crispEdges"
  />
  <path
    d="M460.9,188.3L580.1,129.8L477.2,99.5Z"
    fill="rgb(218,121,63)"
    shape-rendering="crispEdges"
  />
  <path
    d="M119.3,448.5L198.6,477.3L181.5,397.3Z"
    fill="rgb(192,119,74)"
    shape-rendering="crispEdges"
  />
  <path
    d="M139.8,-13L48.8,-40L97.6,55.4Z"
    fill="rgb(255,234,214)"
    shape-rendering="crispEdges"
  />
  <path
    d="M11.8,55L-45.4,68.9L-51.2,142.1Z"
    fill="rgb(255,229,203)"
    shape-rendering="crispEdges"
  />
  <path
    d="M55.8,-72.4L48.8,-40L139.8,-13Z"
    fill="rgb(255,237,219)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-51.2,-28.7L-45.4,68.9L11.8,55Z"
    fill="rgb(255,240,226)"
    shape-rendering="crispEdges"
  />
  <path
    d="M398.9,441.1L475.3,347.4L429.7,337Z"
    fill="rgb(183,62,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M30.6,329.6L33.1,424.7L98.3,373.8Z"
    fill="rgb(207,139,106)"
    shape-rendering="crispEdges"
  />
  <path
    d="M119.3,448.5L109.2,505.4L198.6,477.3Z"
    fill="rgb(193,123,82)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-45.4,355L15.9,285.3L-12.5,248.2Z"
    fill="rgb(249,162,122)"
    shape-rendering="crispEdges"
  />
  <path
    d="M578.5,71.8L489,56.6L477.2,99.5Z"
    fill="rgb(219,138,93)"
    shape-rendering="crispEdges"
  />
  <path
    d="M477.2,99.5L489,56.6L409.6,105Z"
    fill="rgb(239,144,92)"
    shape-rendering="crispEdges"
  />
  <path
    d="M263,-108.4L180.5,-3.4L262.8,-4.9Z"
    fill="rgb(255,207,167)"
    shape-rendering="crispEdges"
  />
  <path
    d="M341.2,-113.3L263,-108.4L347.7,-31.8Z"
    fill="rgb(255,189,143)"
    shape-rendering="crispEdges"
  />
  <path
    d="M347.7,-31.8L263,-108.4L262.8,-4.9Z"
    fill="rgb(255,195,150)"
    shape-rendering="crispEdges"
  />
  <path
    d="M355.9,480.4L398.9,441.1L319.3,434.5Z"
    fill="rgb(184,75,16)"
    shape-rendering="crispEdges"
  />
  <path
    d="M319.3,434.5L398.9,441.1L359,353.3Z"
    fill="rgb(184,75,16)"
    shape-rendering="crispEdges"
  />
  <path
    d="M263,-108.4L183.9,-113.5L180.5,-3.4Z"
    fill="rgb(255,213,176)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-117.4,259.1L-45.4,355L-12.5,248.2Z"
    fill="rgb(251,165,124)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-117.4,259.1L-12.5,248.2L-41.8,193.3Z"
    fill="rgb(255,182,136)"
    shape-rendering="crispEdges"
  />
  <path
    d="M134.1,-95.9L55.8,-72.4L139.8,-13Z"
    fill="rgb(255,232,210)"
    shape-rendering="crispEdges"
  />
  <path
    d="M48.8,-40L-51.2,-28.7L11.8,55Z"
    fill="rgb(255,245,234)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-27.5,-127L55.8,-72.4L134.1,-95.9Z"
    fill="rgb(255,240,224)"
    shape-rendering="crispEdges"
  />
  <path
    d="M489,56.6L440.3,-36.4L385.1,50.1Z"
    fill="rgb(248,160,116)"
    shape-rendering="crispEdges"
  />
  <path
    d="M274.4,510.6L355.9,480.4L319.3,434.5Z"
    fill="rgb(187,85,27)"
    shape-rendering="crispEdges"
  />
  <path
    d="M198.6,477.3L274.4,510.6L264.1,402.7Z"
    fill="rgb(189,101,48)"
    shape-rendering="crispEdges"
  />
  <path
    d="M109.2,505.4L274.4,510.6L198.6,477.3Z"
    fill="rgb(191,112,65)"
    shape-rendering="crispEdges"
  />
  <path
    d="M385.9,-125.7L341.2,-113.3L347.7,-31.8Z"
    fill="rgb(255,180,134)"
    shape-rendering="crispEdges"
  />
  <path
    d="M263,-108.4L385.9,-125.7L183.9,-113.5Z"
    fill="rgb(255,198,154)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-101.2,100.4L-110.3,205L-51.2,142.1Z"
    fill="rgb(255,210,171)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-51.2,142.1L-110.3,205L-41.8,193.3Z"
    fill="rgb(255,200,156)"
    shape-rendering="crispEdges"
  />
  <path
    d="M13.4,494.1L109.2,505.4L33.1,424.7Z"
    fill="rgb(196,135,104)"
    shape-rendering="crispEdges"
  />
  <path
    d="M33.1,424.7L109.2,505.4L119.3,448.5Z"
    fill="rgb(195,131,97)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-124.8,26.8L-101.2,100.4L-45.4,68.9Z"
    fill="rgb(255,234,214)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-45.4,68.9L-101.2,100.4L-51.2,142.1Z"
    fill="rgb(255,225,196)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-25,486.6L-17.8,441.4L-108.9,447.4Z"
    fill="rgb(198,139,113)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-45.4,355L-17.8,441.4L33.1,424.7Z"
    fill="rgb(198,139,113)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-124.8,26.8L-117.4,259.1L-110.3,205Z"
    fill="rgb(255,205,164)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-110.3,205L-117.4,259.1L-41.8,193.3Z"
    fill="rgb(255,187,141)"
    shape-rendering="crispEdges"
  />
  <path
    d="M571.9,368.9L561.9,266.2L480.7,296.8Z"
    fill="rgb(182,60,3)"
    shape-rendering="crispEdges"
  />
  <path
    d="M480.7,296.8L561.9,266.2L460.9,188.3Z"
    fill="rgb(211,82,10)"
    shape-rendering="crispEdges"
  />
  <path
    d="M571.9,368.9L480.7,296.8L475.3,347.4Z"
    fill="rgb(177,58,3)"
    shape-rendering="crispEdges"
  />
  <path
    d="M55.8,-72.4L-51.2,-28.7L48.8,-40Z"
    fill="rgb(255,243,232)"
    shape-rendering="crispEdges"
  />
  <path
    d="M424.9,507.2L495.9,420L398.9,441.1Z"
    fill="rgb(172,57,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M398.9,441.1L495.9,420L475.3,347.4Z"
    fill="rgb(169,54,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M440.3,-36.4L385.9,-125.7L347.7,-31.8Z"
    fill="rgb(255,173,128)"
    shape-rendering="crispEdges"
  />
  <path
    d="M341.2,-113.3L385.9,-125.7L263,-108.4Z"
    fill="rgb(255,186,140)"
    shape-rendering="crispEdges"
  />
  <path
    d="M561.9,266.2L582.2,206.1L460.9,188.3Z"
    fill="rgb(204,89,24)"
    shape-rendering="crispEdges"
  />
  <path
    d="M489,56.6L502.6,-42.7L440.3,-36.4Z"
    fill="rgb(238,157,120)"
    shape-rendering="crispEdges"
  />
  <path
    d="M582.2,206.1L580.1,129.8L460.9,188.3Z"
    fill="rgb(206,104,44)"
    shape-rendering="crispEdges"
  />
  <path
    d="M440.3,-36.4L499.2,-107.7L385.9,-125.7Z"
    fill="rgb(249,163,122)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-17.8,441.4L13.4,494.1L33.1,424.7Z"
    fill="rgb(198,139,112)"
    shape-rendering="crispEdges"
  />
  <path
    d="M589.5,-7.8L502.6,-42.7L489,56.6Z"
    fill="rgb(219,149,116)"
    shape-rendering="crispEdges"
  />
  <path
    d="M274.4,510.6L424.9,507.2L355.9,480.4Z"
    fill="rgb(184,77,18)"
    shape-rendering="crispEdges"
  />
  <path
    d="M355.9,480.4L424.9,507.2L398.9,441.1Z"
    fill="rgb(180,67,9)"
    shape-rendering="crispEdges"
  />
  <path
    d="M580.1,129.8L578.5,71.8L477.2,99.5Z"
    fill="rgb(208,129,82)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-108.9,447.4L-17.8,441.4L-45.4,355Z"
    fill="rgb(198,139,113)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-17.8,441.4L-25,486.6L13.4,494.1Z"
    fill="rgb(198,139,113)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-51.2,-28.7L-124.8,26.8L-45.4,68.9Z"
    fill="rgb(255,242,228)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-101.2,100.4L-124.8,26.8L-110.3,205Z"
    fill="rgb(255,223,192)"
    shape-rendering="crispEdges"
  />
  <path
    d="M567.1,446.7L571.9,368.9L495.9,420Z"
    fill="rgb(141,44,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M495.9,420L571.9,368.9L475.3,347.4Z"
    fill="rgb(158,51,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M634.5,255.6L620.5,194.3L582.2,206.1Z"
    fill="rgb(186,83,24)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-124.8,26.8L-137.2,362.3L-117.4,259.1Z"
    fill="rgb(255,188,142)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-117.4,259.1L-137.2,362.3L-45.4,355Z"
    fill="rgb(234,155,119)"
    shape-rendering="crispEdges"
  />
  <path
    d="M582.2,206.1L620.5,194.3L580.1,129.8Z"
    fill="rgb(191,98,42)"
    shape-rendering="crispEdges"
  />
  <path
    d="M580.1,129.8L634.8,102.7L578.5,71.8Z"
    fill="rgb(193,122,79)"
    shape-rendering="crispEdges"
  />
  <path
    d="M634.5,255.6L582.2,206.1L561.9,266.2Z"
    fill="rgb(185,75,14)"
    shape-rendering="crispEdges"
  />
  <path
    d="M55.8,-72.4L-27.5,-127L-51.2,-28.7Z"
    fill="rgb(255,245,235)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-51.2,-28.7L-128,-52.3L-124.8,26.8Z"
    fill="rgb(255,245,235)"
    shape-rendering="crispEdges"
  />
  <path
    d="M183.9,-113.5L-27.5,-127L134.1,-95.9Z"
    fill="rgb(255,234,214)"
    shape-rendering="crispEdges"
  />
  <path
    d="M385.9,-125.7L-27.5,-127L183.9,-113.5Z"
    fill="rgb(255,219,187)"
    shape-rendering="crispEdges"
  />
  <path
    d="M583.8,-95.9L499.2,-107.7L502.6,-42.7Z"
    fill="rgb(219,149,117)"
    shape-rendering="crispEdges"
  />
  <path
    d="M502.6,-42.7L499.2,-107.7L440.3,-36.4Z"
    fill="rgb(236,156,120)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-137.2,362.3L-108.9,447.4L-45.4,355Z"
    fill="rgb(203,142,114)"
    shape-rendering="crispEdges"
  />
  <path
    d="M621.6,364.5L634.5,255.6L561.9,266.2Z"
    fill="rgb(172,57,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M623.3,33.9L589.5,-7.8L578.5,71.8Z"
    fill="rgb(197,135,105)"
    shape-rendering="crispEdges"
  />
  <path
    d="M578.5,71.8L589.5,-7.8L489,56.6Z"
    fill="rgb(210,140,105)"
    shape-rendering="crispEdges"
  />
  <path
    d="M634.8,102.7L580.1,129.8L620.5,194.3Z"
    fill="rgb(190,108,58)"
    shape-rendering="crispEdges"
  />
  <path
    d="M720,99.7L634.8,102.7L731.2,194.2Z"
    fill="rgb(191,111,63)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-120.9,-78.9L-128,-52.3L-51.2,-28.7Z"
    fill="rgb(255,245,235)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-124.8,26.8L-128,-52.3L-137.2,362.3Z"
    fill="rgb(255,222,191)"
    shape-rendering="crispEdges"
  />
  <path
    d="M506.5,518L567.1,446.7L495.9,420Z"
    fill="rgb(147,47,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M571.9,368.9L621.6,364.5L561.9,266.2Z"
    fill="rgb(158,51,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M634.8,102.7L623.3,33.9L578.5,71.8Z"
    fill="rgb(194,128,92)"
    shape-rendering="crispEdges"
  />
  <path
    d="M424.9,507.2L506.5,518L495.9,420Z"
    fill="rgb(162,52,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M274.4,510.6L506.5,518L424.9,507.2Z"
    fill="rgb(178,66,8)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-106.7,507.9L506.5,518L274.4,510.6Z"
    fill="rgb(190,106,54)"
    shape-rendering="crispEdges"
  />
  <path
    d="M633.5,409.3L621.6,364.5L571.9,368.9Z"
    fill="rgb(134,42,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-27.5,-127L-120.9,-78.9L-51.2,-28.7Z"
    fill="rgb(255,245,235)"
    shape-rendering="crispEdges"
  />
  <path
    d="M623.3,33.9L612,-9.3L589.5,-7.8Z"
    fill="rgb(198,139,112)"
    shape-rendering="crispEdges"
  />
  <path
    d="M589.5,-7.8L583.8,-95.9L502.6,-42.7Z"
    fill="rgb(210,145,115)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-137.2,362.3L-106.7,507.9L-108.9,447.4Z"
    fill="rgb(198,139,113)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-108.9,447.4L-106.7,507.9L-25,486.6Z"
    fill="rgb(198,139,113)"
    shape-rendering="crispEdges"
  />
  <path
    d="M-25,486.6L-106.7,507.9L13.4,494.1Z"
    fill="rgb(198,139,113)"
    shape-rendering="crispEdges"
  />
  <path
    d="M13.4,494.1L-106.7,507.9L109.2,505.4Z"
    fill="rgb(198,139,113)"
    shape-rendering="crispEdges"
  />
  <path
    d="M109.2,505.4L-106.7,507.9L274.4,510.6Z"
    fill="rgb(195,130,96)"
    shape-rendering="crispEdges"
  />
  <path
    d="M506.5,518L557,510.1L567.1,446.7Z"
    fill="rgb(141,45,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M567.1,446.7L633.5,409.3L571.9,368.9Z"
    fill="rgb(129,40,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M633.7,-73.7L583.8,-95.9L589.5,-7.8Z"
    fill="rgb(198,139,113)"
    shape-rendering="crispEdges"
  />
  <path
    d="M499.2,-107.7L693,-95.3L385.9,-125.7Z"
    fill="rgb(220,149,117)"
    shape-rendering="crispEdges"
  />
  <path
    d="M655.4,489L633.5,409.3L567.1,446.7Z"
    fill="rgb(127,39,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M621.6,364.5L685.5,355L634.5,255.6Z"
    fill="rgb(158,51,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M714.1,-16.8L633.7,-73.7L612,-9.3Z"
    fill="rgb(198,139,113)"
    shape-rendering="crispEdges"
  />
  <path
    d="M612,-9.3L633.7,-73.7L589.5,-7.8Z"
    fill="rgb(198,139,113)"
    shape-rendering="crispEdges"
  />
  <path
    d="M714.1,-16.8L612,-9.3L623.3,33.9Z"
    fill="rgb(198,139,113)"
    shape-rendering="crispEdges"
  />
  <path
    d="M723.9,406.8L685.5,355L633.5,409.3Z"
    fill="rgb(131,40,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M633.5,409.3L685.5,355L621.6,364.5Z"
    fill="rgb(136,42,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M731.2,194.2L634.8,102.7L620.5,194.3Z"
    fill="rgb(189,101,48)"
    shape-rendering="crispEdges"
  />
  <path
    d="M634.8,102.7L718.2,67.3L623.3,33.9Z"
    fill="rgb(194,129,93)"
    shape-rendering="crispEdges"
  />
  <path
    d="M731.2,194.2L620.5,194.3L634.5,255.6Z"
    fill="rgb(187,84,26)"
    shape-rendering="crispEdges"
  />
  <path
    d="M734.1,257.3L731.2,194.2L634.5,255.6Z"
    fill="rgb(184,76,17)"
    shape-rendering="crispEdges"
  />
  <path
    d="M720,99.7L718.2,67.3L634.8,102.7Z"
    fill="rgb(193,124,84)"
    shape-rendering="crispEdges"
  />
  <path
    d="M731.2,194.2L718.2,67.3L720,99.7Z"
    fill="rgb(191,115,70)"
    shape-rendering="crispEdges"
  />
  <path
    d="M685.5,355L734.1,257.3L634.5,255.6Z"
    fill="rgb(173,59,5)"
    shape-rendering="crispEdges"
  />
  <path
    d="M557,510.1L655.4,489L567.1,446.7Z"
    fill="rgb(129,40,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M685.5,355L723.9,406.8L734.1,257.3Z"
    fill="rgb(151,48,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M731.2,194.2L714.1,-16.8L718.2,67.3Z"
    fill="rgb(194,126,88)"
    shape-rendering="crispEdges"
  />
  <path
    d="M718.2,67.3L714.1,-16.8L623.3,33.9Z"
    fill="rgb(197,136,106)"
    shape-rendering="crispEdges"
  />
  <path
    d="M655.4,489L723.9,406.8L633.5,409.3Z"
    fill="rgb(127,39,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M714.1,-16.8L693,-95.3L633.7,-73.7Z"
    fill="rgb(198,139,113)"
    shape-rendering="crispEdges"
  />
  <path
    d="M633.7,-73.7L693,-95.3L583.8,-95.9Z"
    fill="rgb(198,139,113)"
    shape-rendering="crispEdges"
  />
  <path
    d="M583.8,-95.9L693,-95.3L499.2,-107.7Z"
    fill="rgb(200,141,114)"
    shape-rendering="crispEdges"
  />
  <path
    d="M557,510.1L702.1,509.8L655.4,489Z"
    fill="rgb(127,39,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M655.4,489L702.1,509.8L723.9,406.8Z"
    fill="rgb(127,39,4)"
    shape-rendering="crispEdges"
  />
  <path
    d="M506.5,518L702.1,509.8L557,510.1Z"
    fill="rgb(130,40,4)"
    shape-rendering="crispEdges"
  />
</svg>
`;

exports[`Pattern outputs in browser environment #toSVGTree serializes to an SVG string 1`] = `"<svg xmlns='http://www.w3.org/2000/svg' width='600' height='400'><path d='M328.5,188.8L353.6,140.5L281.7,122.4Z' fill='rgb(254,152,65)' shape-rendering='crispEdges'></path><path d='M281.7,122.4L250.2,188.1L328.5,188.8Z' fill='rgb(254,157,67)' shape-rendering='crispEdges'></path><path d='M353.6,140.5L316.1,62.5L281.7,122.4Z' fill='rgb(255,171,83)' shape-rendering='crispEdges'></path><path d='M419.7,172.6L416.5,122.8L353.6,140.5Z' fill='rgb(252,130,58)' shape-rendering='crispEdges'></path><path d='M353.6,140.5L416.5,122.8L316.1,62.5Z' fill='rgb(255,155,77)' shape-rendering='crispEdges'></path><path d='M328.5,188.8L419.7,172.6L353.6,140.5Z' fill='rgb(254,129,57)' shape-rendering='crispEdges'></path><path d='M250.2,188.1L329.1,259.4L328.5,188.8Z' fill='rgb(253,133,57)' shape-rendering='crispEdges'></path><path d='M328.5,188.8L329.1,259.4L419.7,172.6Z' fill='rgb(253,114,51)' shape-rendering='crispEdges'></path><path d='M310.4,0.1L270.1,34.7L316.1,62.5Z' fill='rgb(255,193,118)' shape-rendering='crispEdges'></path><path d='M316.1,62.5L270.1,34.7L281.7,122.4Z' fill='rgb(255,188,101)' shape-rendering='crispEdges'></path><path d='M281.7,122.4L178.5,152.4L250.2,188.1Z' fill='rgb(254,174,74)' shape-rendering='crispEdges'></path><path d='M250.2,188.1L257.3,268L329.1,259.4Z' fill='rgb(254,125,55)' shape-rendering='crispEdges'></path><path d='M180.9,49.7L178.5,152.4L281.7,122.4Z' fill='rgb(255,197,97)' shape-rendering='crispEdges'></path><path d='M250.2,188.1L186.7,217.3L257.3,268Z' fill='rgb(254,145,62)' shape-rendering='crispEdges'></path><path d='M178.5,152.4L186.7,217.3L250.2,188.1Z' fill='rgb(254,170,76)' shape-rendering='crispEdges'></path><path d='M401.1,-1.1L310.4,0.1L316.1,62.5Z' fill='rgb(255,181,116)' shape-rendering='crispEdges'></path><path d='M464.7,30.5L418.6,36.5L416.5,122.8Z' fill='rgb(251,149,87)' shape-rendering='crispEdges'></path><path d='M416.5,122.8L418.6,36.5L316.1,62.5Z' fill='rgb(255,157,88)' shape-rendering='crispEdges'></path><path d='M239.2,-8.2L180.9,49.7L270.1,34.7Z' fill='rgb(255,211,129)' shape-rendering='crispEdges'></path><path d='M270.1,34.7L180.9,49.7L281.7,122.4Z' fill='rgb(255,199,108)' shape-rendering='crispEdges'></path><path d='M114.4,204.2L185.4,265.4L186.7,217.3Z' fill='rgb(255,162,80)' shape-rendering='crispEdges'></path><path d='M186.7,217.3L185.4,265.4L257.3,268Z' fill='rgb(255,137,62)' shape-rendering='crispEdges'></path><path d='M310.4,0.1L239.2,-8.2L270.1,34.7Z' fill='rgb(255,203,131)' shape-rendering='crispEdges'></path><path d='M257.3,268L340.7,322.6L329.1,259.4Z' fill='rgb(245,97,45)' shape-rendering='crispEdges'></path><path d='M329.1,259.4L434.5,279.8L419.7,172.6Z' fill='rgb(249,83,42)' shape-rendering='crispEdges'></path><path d='M267.6,344.4L340.7,322.6L257.3,268Z' fill='rgb(237,97,46)' shape-rendering='crispEdges'></path><path d='M418.6,36.5L401.1,-1.1L316.1,62.5Z' fill='rgb(255,166,106)' shape-rendering='crispEdges'></path><path d='M238.3,-106.1L197.3,-31.7L239.2,-8.2Z' fill='rgb(255,216,140)' shape-rendering='crispEdges'></path><path d='M340.7,322.6L434.5,279.8L329.1,259.4Z' fill='rgb(243,66,37)' shape-rendering='crispEdges'></path><path d='M419.7,172.6L510.3,150.2L416.5,122.8Z' fill='rgb(243,117,51)' shape-rendering='crispEdges'></path><path d='M434.5,279.8L474.2,226.2L419.7,172.6Z' fill='rgb(242,78,39)' shape-rendering='crispEdges'></path><path d='M180.9,49.7L123.1,148.7L178.5,152.4Z' fill='rgb(254,208,108)' shape-rendering='crispEdges'></path><path d='M178.5,152.4L114.4,204.2L186.7,217.3Z' fill='rgb(255,180,87)' shape-rendering='crispEdges'></path><path d='M510.3,150.2L464.7,30.5L416.5,122.8Z' fill='rgb(243,136,71)' shape-rendering='crispEdges'></path><path d='M418.6,36.5L464.7,30.5L401.1,-1.1Z' fill='rgb(255,158,105)' shape-rendering='crispEdges'></path><path d='M474.2,226.2L510.3,150.2L419.7,172.6Z' fill='rgb(237,101,47)' shape-rendering='crispEdges'></path><path d='M208,364.5L267.6,344.4L257.3,268Z' fill='rgb(233,107,52)' shape-rendering='crispEdges'></path><path d='M123.1,148.7L114.4,204.2L178.5,152.4Z' fill='rgb(255,193,97)' shape-rendering='crispEdges'></path><path d='M185.4,265.4L208,364.5L257.3,268Z' fill='rgb(244,119,53)' shape-rendering='crispEdges'></path><path d='M239.2,-8.2L197.3,-31.7L180.9,49.7Z' fill='rgb(255,221,144)' shape-rendering='crispEdges'></path><path d='M180.9,49.7L101.9,64.4L123.1,148.7Z' fill='rgb(254,221,127)' shape-rendering='crispEdges'></path><path d='M238.3,-106.1L239.2,-8.2L310.4,0.1Z' fill='rgb(255,207,136)' shape-rendering='crispEdges'></path><path d='M413.7,-105.2L352,-72.3L401.1,-1.1Z' fill='rgb(255,170,119)' shape-rendering='crispEdges'></path><path d='M401.1,-1.1L352,-72.3L310.4,0.1Z' fill='rgb(255,180,123)' shape-rendering='crispEdges'></path><path d='M123.1,-41.2L101.9,64.4L180.9,49.7Z' fill='rgb(255,233,155)' shape-rendering='crispEdges'></path><path d='M123.1,148.7L52.8,189.8L114.4,204.2Z' fill='rgb(255,194,107)' shape-rendering='crispEdges'></path><path d='M392,418.9L427.9,350.5L340.7,322.6Z' fill='rgb(209,43,40)' shape-rendering='crispEdges'></path><path d='M340.7,322.6L427.9,350.5L434.5,279.8Z' fill='rgb(228,44,35)' shape-rendering='crispEdges'></path><path d='M434.5,279.8L513.3,302.5L474.2,226.2Z' fill='rgb(228,43,34)' shape-rendering='crispEdges'></path><path d='M474.2,226.2L554.2,190L510.3,150.2Z' fill='rgb(225,93,50)' shape-rendering='crispEdges'></path><path d='M101.8,276.1L208,364.5L185.4,265.4Z' fill='rgb(245,133,67)' shape-rendering='crispEdges'></path><path d='M267.6,344.4L337,422.1L340.7,322.6Z' fill='rgb(213,78,48)' shape-rendering='crispEdges'></path><path d='M513.3,302.5L554.2,190L474.2,226.2Z' fill='rgb(223,59,41)' shape-rendering='crispEdges'></path><path d='M560.5,38.7L515.5,-20.7L464.7,30.5Z' fill='rgb(234,147,108)' shape-rendering='crispEdges'></path><path d='M114.4,204.2L101.8,276.1L185.4,265.4Z' fill='rgb(255,157,83)' shape-rendering='crispEdges'></path><path d='M52.8,189.8L101.8,276.1L114.4,204.2Z' fill='rgb(255,176,101)' shape-rendering='crispEdges'></path><path d='M478.1,357.5L513.3,302.5L434.5,279.8Z' fill='rgb(215,19,32)' shape-rendering='crispEdges'></path><path d='M39.5,133.8L52.8,189.8L123.1,148.7Z' fill='rgb(255,205,118)' shape-rendering='crispEdges'></path><path d='M560.5,38.7L464.7,30.5L510.3,150.2Z' fill='rgb(231,136,85)' shape-rendering='crispEdges'></path><path d='M464.7,30.5L515.5,-20.7L401.1,-1.1Z' fill='rgb(250,155,111)' shape-rendering='crispEdges'></path><path d='M460.4,439L478.1,357.5L427.9,350.5Z' fill='rgb(186,11,35)' shape-rendering='crispEdges'></path><path d='M427.9,350.5L478.1,357.5L434.5,279.8Z' fill='rgb(216,21,32)' shape-rendering='crispEdges'></path><path d='M352,-72.3L238.3,-106.1L310.4,0.1Z' fill='rgb(255,198,132)' shape-rendering='crispEdges'></path><path d='M197.3,-31.7L123.1,-41.2L180.9,49.7Z' fill='rgb(255,231,156)' shape-rendering='crispEdges'></path><path d='M200.4,-99.4L123.1,-41.2L197.3,-31.7Z' fill='rgb(255,230,155)' shape-rendering='crispEdges'></path><path d='M101.9,64.4L39.5,133.8L123.1,148.7Z' fill='rgb(255,219,129)' shape-rendering='crispEdges'></path><path d='M621.4,208.2L583.6,130.8L554.2,190Z' fill='rgb(196,90,54)' shape-rendering='crispEdges'></path><path d='M554.2,190L583.6,130.8L510.3,150.2Z' fill='rgb(213,102,56)' shape-rendering='crispEdges'></path><path d='M583.6,130.8L560.5,38.7L510.3,150.2Z' fill='rgb(214,123,73)' shape-rendering='crispEdges'></path><path d='M243.1,451.3L337,422.1L267.6,344.4Z' fill='rgb(190,83,52)' shape-rendering='crispEdges'></path><path d='M238.3,-106.1L200.4,-99.4L197.3,-31.7Z' fill='rgb(255,220,144)' shape-rendering='crispEdges'></path><path d='M53.2,53.8L39.5,133.8L101.9,64.4Z' fill='rgb(255,231,149)' shape-rendering='crispEdges'></path><path d='M473.5,-105.4L413.7,-105.2L401.1,-1.1Z' fill='rgb(255,161,114)' shape-rendering='crispEdges'></path><path d='M352,-72.3L413.7,-105.2L238.3,-106.1Z' fill='rgb(255,187,126)' shape-rendering='crispEdges'></path><path d='M32.8,-7.1L53.2,53.8L101.9,64.4Z' fill='rgb(255,241,169)' shape-rendering='crispEdges'></path><path d='M337,422.1L392,418.9L340.7,322.6Z' fill='rgb(196,55,44)' shape-rendering='crispEdges'></path><path d='M563.1,328.8L553.8,302L513.3,302.5Z' fill='rgb(196,10,35)' shape-rendering='crispEdges'></path><path d='M513.3,302.5L553.8,302L554.2,190Z' fill='rgb(210,39,39)' shape-rendering='crispEdges'></path><path d='M101.8,276.1L97.9,372.3L208,364.5Z' fill='rgb(232,133,78)' shape-rendering='crispEdges'></path><path d='M52.8,189.8L64.9,293.1L101.8,276.1Z' fill='rgb(255,163,99)' shape-rendering='crispEdges'></path><path d='M14,333L64.9,293.1L-43.3,282.2Z' fill='rgb(251,155,109)' shape-rendering='crispEdges'></path><path d='M515.5,-20.7L473.5,-105.4L401.1,-1.1Z' fill='rgb(249,155,112)' shape-rendering='crispEdges'></path><path d='M556.3,-122.4L89.6,-119.3L238.3,-106.1Z' fill='rgb(255,200,132)' shape-rendering='crispEdges'></path><path d='M547,-47.6L473.5,-105.4L515.5,-20.7Z' fill='rgb(236,150,115)' shape-rendering='crispEdges'></path><path d='M656.2,-7.6L547,-47.6L560.5,38.7Z' fill='rgb(203,138,115)' shape-rendering='crispEdges'></path><path d='M560.5,38.7L547,-47.6L515.5,-20.7Z' fill='rgb(225,146,115)' shape-rendering='crispEdges'></path><path d='M478.1,357.5L563.1,328.8L513.3,302.5Z' fill='rgb(198,7,36)' shape-rendering='crispEdges'></path><path d='M553.8,302L621.4,208.2L554.2,190Z' fill='rgb(199,59,44)' shape-rendering='crispEdges'></path><path d='M573.7,422.9L563.1,328.8L478.1,357.5Z' fill='rgb(171,0,38)' shape-rendering='crispEdges'></path><path d='M208,364.5L243.1,451.3L267.6,344.4Z' fill='rgb(199,97,56)' shape-rendering='crispEdges'></path><path d='M384.9,488.1L460.4,439L392,418.9Z' fill='rgb(182,30,38)' shape-rendering='crispEdges'></path><path d='M178.4,431.9L243.1,451.3L208,364.5Z' fill='rgb(191,103,62)' shape-rendering='crispEdges'></path><path d='M64.9,293.1L97.9,372.3L101.8,276.1Z' fill='rgb(243,144,89)' shape-rendering='crispEdges'></path><path d='M97.9,372.3L178.4,431.9L208,364.5Z' fill='rgb(200,118,73)' shape-rendering='crispEdges'></path><path d='M654.4,267L621.4,208.2L553.8,302Z' fill='rgb(186,38,41)' shape-rendering='crispEdges'></path><path d='M583.6,130.8L635.5,68.4L560.5,38.7Z' fill='rgb(197,123,84)' shape-rendering='crispEdges'></path><path d='M53.2,53.8L-33.3,126.9L39.5,133.8Z' fill='rgb(255,232,153)' shape-rendering='crispEdges'></path><path d='M123.1,-41.2L32.8,-7.1L101.9,64.4Z' fill='rgb(255,244,177)' shape-rendering='crispEdges'></path><path d='M44.5,-92.6L32.8,-7.1L123.1,-41.2Z' fill='rgb(255,247,184)' shape-rendering='crispEdges'></path><path d='M384.9,488.1L392,418.9L337,422.1Z' fill='rgb(188,45,42)' shape-rendering='crispEdges'></path><path d='M392,418.9L460.4,439L427.9,350.5Z' fill='rgb(180,24,37)' shape-rendering='crispEdges'></path><path d='M646.9,129.9L635.5,68.4L583.6,130.8Z' fill='rgb(193,115,73)' shape-rendering='crispEdges'></path><path d='M621.4,208.2L646.9,129.9L583.6,130.8Z' fill='rgb(191,96,57)' shape-rendering='crispEdges'></path><path d='M44.6,431.1L120.3,428.8L97.9,372.3Z' fill='rgb(195,126,92)' shape-rendering='crispEdges'></path><path d='M97.9,372.3L120.3,428.8L178.4,431.9Z' fill='rgb(193,121,81)' shape-rendering='crispEdges'></path><path d='M201.6,503.2L271.9,506.5L243.1,451.3Z' fill='rgb(191,95,56)' shape-rendering='crispEdges'></path><path d='M344.1,512.3L384.9,488.1L337,422.1Z' fill='rgb(189,54,44)' shape-rendering='crispEdges'></path><path d='M271.9,506.5L337,422.1L243.1,451.3Z' fill='rgb(190,83,52)' shape-rendering='crispEdges'></path><path d='M-65.2,49.9L-33.3,126.9L53.2,53.8Z' fill='rgb(255,241,171)' shape-rendering='crispEdges'></path><path d='M39.5,133.8L-33.3,126.9L52.8,189.8Z' fill='rgb(255,214,135)' shape-rendering='crispEdges'></path><path d='M64.9,293.1L14,333L97.9,372.3Z' fill='rgb(237,144,98)' shape-rendering='crispEdges'></path><path d='M238.3,-106.1L89.6,-119.3L200.4,-99.4Z' fill='rgb(255,229,154)' shape-rendering='crispEdges'></path><path d='M200.4,-99.4L89.6,-119.3L123.1,-41.2Z' fill='rgb(255,237,165)' shape-rendering='crispEdges'></path><path d='M556.3,-122.4L238.3,-106.1L413.7,-105.2Z' fill='rgb(255,167,117)' shape-rendering='crispEdges'></path><path d='M-43.3,282.2L64.9,293.1L52.8,189.8Z' fill='rgb(255,168,113)' shape-rendering='crispEdges'></path><path d='M201.6,503.2L243.1,451.3L178.4,431.9Z' fill='rgb(191,103,62)' shape-rendering='crispEdges'></path><path d='M619.3,366.9L654.4,267L563.1,328.8Z' fill='rgb(169,6,36)' shape-rendering='crispEdges'></path><path d='M563.1,328.8L654.4,267L553.8,302Z' fill='rgb(181,12,35)' shape-rendering='crispEdges'></path><path d='M621.4,208.2L705.9,172.4L646.9,129.9Z' fill='rgb(190,91,55)' shape-rendering='crispEdges'></path><path d='M89.6,-119.3L44.5,-92.6L123.1,-41.2Z' fill='rgb(255,245,179)' shape-rendering='crispEdges'></path><path d='M32.8,-7.1L-65.2,49.9L53.2,53.8Z' fill='rgb(255,248,188)' shape-rendering='crispEdges'></path><path d='M271.9,506.5L344.1,512.3L337,422.1Z' fill='rgb(189,71,48)' shape-rendering='crispEdges'></path><path d='M654.5,-118.9L556.3,-122.4L547,-47.6Z' fill='rgb(204,139,115)' shape-rendering='crispEdges'></path><path d='M547,-47.6L556.3,-122.4L473.5,-105.4Z' fill='rgb(232,148,115)' shape-rendering='crispEdges'></path><path d='M473.5,-105.4L556.3,-122.4L413.7,-105.2Z' fill='rgb(244,153,113)' shape-rendering='crispEdges'></path><path d='M134.9,479.8L201.6,503.2L178.4,431.9Z' fill='rgb(192,113,71)' shape-rendering='crispEdges'></path><path d='M271.9,506.5L13.3,517.2L344.1,512.3Z' fill='rgb(191,103,62)' shape-rendering='crispEdges'></path><path d='M134.9,479.8L178.4,431.9L120.3,428.8Z' fill='rgb(193,119,78)' shape-rendering='crispEdges'></path><path d='M-33.3,126.9L-56.2,198.2L52.8,189.8Z' fill='rgb(255,209,137)' shape-rendering='crispEdges'></path><path d='M44.6,431.1L134.9,479.8L120.3,428.8Z' fill='rgb(194,125,89)' shape-rendering='crispEdges'></path><path d='M573.7,422.9L619.3,366.9L563.1,328.8Z' fill='rgb(150,0,38)' shape-rendering='crispEdges'></path><path d='M573.7,422.9L478.1,357.5L460.4,439Z' fill='rgb(163,3,37)' shape-rendering='crispEdges'></path><path d='M573.7,422.9L460.4,439L484.7,497.6Z' fill='rgb(163,2,38)' shape-rendering='crispEdges'></path><path d='M484.7,497.6L460.4,439L384.9,488.1Z' fill='rgb(177,16,36)' shape-rendering='crispEdges'></path><path d='M685.4,43.2L656.2,-7.6L635.5,68.4Z' fill='rgb(196,131,101)' shape-rendering='crispEdges'></path><path d='M635.5,68.4L656.2,-7.6L560.5,38.7Z' fill='rgb(196,131,102)' shape-rendering='crispEdges'></path><path d='M685.4,43.2L635.5,68.4L646.9,129.9Z' fill='rgb(194,122,84)' shape-rendering='crispEdges'></path><path d='M-56.2,198.2L-43.3,282.2L52.8,189.8Z' fill='rgb(255,187,126)' shape-rendering='crispEdges'></path><path d='M14,333L44.6,431.1L97.9,372.3Z' fill='rgb(210,135,101)' shape-rendering='crispEdges'></path><path d='M710.3,142.6L685.4,43.2L646.9,129.9Z' fill='rgb(193,116,74)' shape-rendering='crispEdges'></path><path d='M344.1,512.3L484.7,497.6L384.9,488.1Z' fill='rgb(184,33,39)' shape-rendering='crispEdges'></path><path d='M-29.1,431.4L44.6,431.1L14,333Z' fill='rgb(198,136,112)' shape-rendering='crispEdges'></path><path d='M-46.7,-30L-65.2,49.9L32.8,-7.1Z' fill='rgb(255,254,202)' shape-rendering='crispEdges'></path><path d='M-33.3,126.9L-113.2,135.3L-56.2,198.2Z' fill='rgb(255,215,140)' shape-rendering='crispEdges'></path><path d='M691.8,284.3L705.9,172.4L654.4,267Z' fill='rgb(189,50,43)' shape-rendering='crispEdges'></path><path d='M654.4,267L705.9,172.4L621.4,208.2Z' fill='rgb(189,69,48)' shape-rendering='crispEdges'></path><path d='M705.9,172.4L710.3,142.6L646.9,129.9Z' fill='rgb(191,99,58)' shape-rendering='crispEdges'></path><path d='M720.1,345L691.8,284.3L619.3,366.9Z' fill='rgb(165,4,37)' shape-rendering='crispEdges'></path><path d='M619.3,366.9L691.8,284.3L654.4,267Z' fill='rgb(174,10,35)' shape-rendering='crispEdges'></path><path d='M705.9,172.4L720.1,345L710.3,142.6Z' fill='rgb(189,66,47)' shape-rendering='crispEdges'></path><path d='M44.5,-92.6L-46.7,-30L32.8,-7.1Z' fill='rgb(255,254,201)' shape-rendering='crispEdges'></path><path d='M-97.5,298.1L-44.5,344.7L-43.3,282.2Z' fill='rgb(250,156,112)' shape-rendering='crispEdges'></path><path d='M-43.3,282.2L-44.5,344.7L14,333Z' fill='rgb(245,153,113)' shape-rendering='crispEdges'></path><path d='M644.9,474.6L618.9,424.7L573.7,422.9Z' fill='rgb(128,0,38)' shape-rendering='crispEdges'></path><path d='M573.7,422.9L618.9,424.7L619.3,366.9Z' fill='rgb(128,0,38)' shape-rendering='crispEdges'></path><path d='M710.3,142.6L704.3,-0.6L685.4,43.2Z' fill='rgb(195,126,91)' shape-rendering='crispEdges'></path><path d='M685.4,43.2L704.3,-0.6L656.2,-7.6Z' fill='rgb(197,135,110)' shape-rendering='crispEdges'></path><path d='M656.2,-7.6L654.5,-118.9L547,-47.6Z' fill='rgb(197,137,115)' shape-rendering='crispEdges'></path><path d='M-101.5,46.1L-113.2,135.3L-65.2,49.9Z' fill='rgb(255,240,171)' shape-rendering='crispEdges'></path><path d='M-65.2,49.9L-113.2,135.3L-33.3,126.9Z' fill='rgb(255,234,159)' shape-rendering='crispEdges'></path><path d='M-56.2,198.2L-97.5,298.1L-43.3,282.2Z' fill='rgb(255,170,119)' shape-rendering='crispEdges'></path><path d='M-46.7,-30L-101.5,46.1L-65.2,49.9Z' fill='rgb(255,251,194)' shape-rendering='crispEdges'></path><path d='M725.5,-98.6L654.5,-118.9L656.2,-7.6Z' fill='rgb(197,137,115)' shape-rendering='crispEdges'></path><path d='M-122.5,207L-97.5,298.1L-56.2,198.2Z' fill='rgb(255,181,124)' shape-rendering='crispEdges'></path><path d='M-44.5,344.7L-29.1,431.4L14,333Z' fill='rgb(218,144,115)' shape-rendering='crispEdges'></path><path d='M-113.2,135.3L-122.5,207L-56.2,198.2Z' fill='rgb(255,206,135)' shape-rendering='crispEdges'></path><path d='M-98.5,398.7L-29.1,431.4L-44.5,344.7Z' fill='rgb(203,138,115)' shape-rendering='crispEdges'></path><path d='M44.6,431.1L13.3,517.2L134.9,479.8Z' fill='rgb(195,129,98)' shape-rendering='crispEdges'></path><path d='M134.9,479.8L13.3,517.2L201.6,503.2Z' fill='rgb(194,123,85)' shape-rendering='crispEdges'></path><path d='M89.6,-119.3L-49.9,-111.2L44.5,-92.6Z' fill='rgb(255,252,196)' shape-rendering='crispEdges'></path><path d='M44.5,-92.6L-49.9,-111.2L-46.7,-30Z' fill='rgb(255,255,204)' shape-rendering='crispEdges'></path><path d='M-46.7,-30L-120.5,-36.4L-101.5,46.1Z' fill='rgb(255,255,204)' shape-rendering='crispEdges'></path><path d='M729.5,416.5L720.1,345L619.3,366.9Z' fill='rgb(142,0,38)' shape-rendering='crispEdges'></path><path d='M691.8,284.3L720.1,345L705.9,172.4Z' fill='rgb(184,34,39)' shape-rendering='crispEdges'></path><path d='M710.3,142.6L725.5,-98.6L704.3,-0.6Z' fill='rgb(197,134,109)' shape-rendering='crispEdges'></path><path d='M344.1,512.3L571,525.9L484.7,497.6Z' fill='rgb(172,8,36)' shape-rendering='crispEdges'></path><path d='M484.7,497.6L571,525.9L573.7,422.9Z' fill='rgb(151,0,38)' shape-rendering='crispEdges'></path><path d='M618.9,424.7L729.5,416.5L619.3,366.9Z' fill='rgb(128,0,38)' shape-rendering='crispEdges'></path><path d='M571,525.9L644.9,474.6L573.7,422.9Z' fill='rgb(129,0,38)' shape-rendering='crispEdges'></path><path d='M-101.5,46.1L-120.5,-36.4L-113.2,135.3Z' fill='rgb(255,246,183)' shape-rendering='crispEdges'></path><path d='M-113.2,135.3L-120.5,-36.4L-122.5,207Z' fill='rgb(255,235,160)' shape-rendering='crispEdges'></path><path d='M-49.9,-111.2L-120.5,-36.4L-46.7,-30Z' fill='rgb(255,255,204)' shape-rendering='crispEdges'></path><path d='M-123.7,487.2L-12.5,492.8L-29.1,431.4Z' fill='rgb(197,137,115)' shape-rendering='crispEdges'></path><path d='M-29.1,431.4L-12.5,492.8L44.6,431.1Z' fill='rgb(197,136,115)' shape-rendering='crispEdges'></path><path d='M201.6,503.2L13.3,517.2L271.9,506.5Z' fill='rgb(193,115,73)' shape-rendering='crispEdges'></path><path d='M344.1,512.3L13.3,517.2L571,525.9Z' fill='rgb(189,75,49)' shape-rendering='crispEdges'></path><path d='M-12.5,492.8L13.3,517.2L44.6,431.1Z' fill='rgb(197,135,111)' shape-rendering='crispEdges'></path><path d='M-125.3,357.8L-98.5,398.7L-44.5,344.7Z' fill='rgb(220,144,115)' shape-rendering='crispEdges'></path><path d='M-125.3,357.8L-44.5,344.7L-97.5,298.1Z' fill='rgb(239,151,114)' shape-rendering='crispEdges'></path><path d='M729.5,416.5L725.5,-98.6L710.3,142.6Z' fill='rgb(191,97,57)' shape-rendering='crispEdges'></path><path d='M704.3,-0.6L725.5,-98.6L656.2,-7.6Z' fill='rgb(197,137,115)' shape-rendering='crispEdges'></path><path d='M-135.4,-109.1L-125.3,357.8L-122.5,207Z' fill='rgb(255,216,140)' shape-rendering='crispEdges'></path><path d='M-122.5,207L-125.3,357.8L-97.5,298.1Z' fill='rgb(255,161,114)' shape-rendering='crispEdges'></path><path d='M644.9,474.6L729.5,416.5L618.9,424.7Z' fill='rgb(128,0,38)' shape-rendering='crispEdges'></path><path d='M720.1,345L729.5,416.5L710.3,142.6Z' fill='rgb(176,11,35)' shape-rendering='crispEdges'></path><path d='M727.5,473.6L729.5,416.5L644.9,474.6Z' fill='rgb(128,0,38)' shape-rendering='crispEdges'></path><path d='M89.6,-119.3L-135.4,-109.1L-49.9,-111.2Z' fill='rgb(255,255,204)' shape-rendering='crispEdges'></path><path d='M-49.9,-111.2L-135.4,-109.1L-120.5,-36.4Z' fill='rgb(255,255,204)' shape-rendering='crispEdges'></path><path d='M-120.5,-36.4L-135.4,-109.1L-122.5,207Z' fill='rgb(255,251,195)' shape-rendering='crispEdges'></path><path d='M571,525.9L727.5,473.6L644.9,474.6Z' fill='rgb(128,0,38)' shape-rendering='crispEdges'></path><path d='M-125.3,357.8L-123.7,487.2L-98.5,398.7Z' fill='rgb(197,137,115)' shape-rendering='crispEdges'></path><path d='M-98.5,398.7L-123.7,487.2L-29.1,431.4Z' fill='rgb(197,137,115)' shape-rendering='crispEdges'></path><path d='M-12.5,492.8L-123.7,487.2L13.3,517.2Z' fill='rgb(197,137,115)' shape-rendering='crispEdges'></path><path d='M-135.4,-109.1L-123.7,487.2L-125.3,357.8Z' fill='rgb(255,175,122)' shape-rendering='crispEdges'></path></svg>"`;


================================================
FILE: src/__snapshots__/trianglify.node.test.js.snap
================================================
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Pattern generation should match snapshot for non-breaking version bumps 1`] = `"<svg xmlns='http://www.w3.org/2000/svg' width='600' height='400'><path d='M342.9,227.4L356,297.7L390.3,294.6Z' fill='rgb(230,107,18)' shape-rendering='crispEdges'></path><path d='M390.3,294.6L396.5,178.3L342.9,227.4Z' fill='rgb(239,119,23)' shape-rendering='crispEdges'></path><path d='M234.9,206.1L285,271.2L342.9,227.4Z' fill='rgb(248,143,37)' shape-rendering='crispEdges'></path><path d='M342.9,227.4L285,271.2L356,297.7Z' fill='rgb(237,120,24)' shape-rendering='crispEdges'></path><path d='M390.3,294.6L491.3,250.7L396.5,178.3Z' fill='rgb(227,104,16)' shape-rendering='crispEdges'></path><path d='M270.7,350.3L316.2,368.3L356,297.7Z' fill='rgb(207,101,20)' shape-rendering='crispEdges'></path><path d='M356,297.7L407.8,377.2L390.3,294.6Z' fill='rgb(206,86,10)' shape-rendering='crispEdges'></path><path d='M390.3,294.6L505.4,325.1L491.3,250.7Z' fill='rgb(203,78,4)' shape-rendering='crispEdges'></path><path d='M388.1,135.7L357.9,136.8L396.5,178.3Z' fill='rgb(245,154,50)' shape-rendering='crispEdges'></path><path d='M396.5,178.3L357.9,136.8L342.9,227.4Z' fill='rgb(247,144,40)' shape-rendering='crispEdges'></path><path d='M499.8,175.6L388.1,135.7L396.5,178.3Z' fill='rgb(235,137,40)' shape-rendering='crispEdges'></path><path d='M316.2,368.3L407.8,377.2L356,297.7Z' fill='rgb(197,86,13)' shape-rendering='crispEdges'></path><path d='M285,271.2L270.7,350.3L356,297.7Z' fill='rgb(225,113,21)' shape-rendering='crispEdges'></path><path d='M259.2,131.7L234.9,206.1L342.9,227.4Z' fill='rgb(254,164,51)' shape-rendering='crispEdges'></path><path d='M285,271.2L202,340.9L270.7,350.3Z' fill='rgb(219,124,35)' shape-rendering='crispEdges'></path><path d='M407.8,377.2L505.4,325.1L390.3,294.6Z' fill='rgb(190,72,4)' shape-rendering='crispEdges'></path><path d='M560.9,258.4L499.8,175.6L491.3,250.7Z' fill='rgb(200,92,16)' shape-rendering='crispEdges'></path><path d='M491.3,250.7L499.8,175.6L396.5,178.3Z' fill='rgb(225,113,22)' shape-rendering='crispEdges'></path><path d='M234.9,206.1L207.1,227.9L285,271.2Z' fill='rgb(249,156,49)' shape-rendering='crispEdges'></path><path d='M344.6,57.3L259.2,131.7L357.9,136.8Z' fill='rgb(255,182,87)' shape-rendering='crispEdges'></path><path d='M357.9,136.8L259.2,131.7L342.9,227.4Z' fill='rgb(252,163,52)' shape-rendering='crispEdges'></path><path d='M234.9,206.1L196.4,142.7L207.1,227.9Z' fill='rgb(255,181,69)' shape-rendering='crispEdges'></path><path d='M235,443.7L333.1,435.1L316.2,368.3Z' fill='rgb(175,94,24)' shape-rendering='crispEdges'></path><path d='M316.2,368.3L333.1,435.1L407.8,377.2Z' fill='rgb(173,80,16)' shape-rendering='crispEdges'></path><path d='M407.8,377.2L495.3,411.4L505.4,325.1Z' fill='rgb(160,57,5)' shape-rendering='crispEdges'></path><path d='M333.1,435.1L438.6,425.2L407.8,377.2Z' fill='rgb(163,69,12)' shape-rendering='crispEdges'></path><path d='M178.4,252.9L202,340.9L285,271.2Z' fill='rgb(235,143,46)' shape-rendering='crispEdges'></path><path d='M270.7,350.3L235,443.7L316.2,368.3Z' fill='rgb(183,103,29)' shape-rendering='crispEdges'></path><path d='M564.8,355.1L560.9,258.4L505.4,325.1Z' fill='rgb(165,59,4)' shape-rendering='crispEdges'></path><path d='M505.4,325.1L560.9,258.4L491.3,250.7Z' fill='rgb(187,73,6)' shape-rendering='crispEdges'></path><path d='M108.6,206.2L178.4,252.9L207.1,227.9Z' fill='rgb(252,176,83)' shape-rendering='crispEdges'></path><path d='M207.1,227.9L178.4,252.9L285,271.2Z' fill='rgb(246,155,51)' shape-rendering='crispEdges'></path><path d='M438.6,425.2L495.3,411.4L407.8,377.2Z' fill='rgb(152,57,7)' shape-rendering='crispEdges'></path><path d='M407.6,22.7L344.6,57.3L388.1,135.7Z' fill='rgb(250,175,97)' shape-rendering='crispEdges'></path><path d='M388.1,135.7L344.6,57.3L357.9,136.8Z' fill='rgb(250,171,80)' shape-rendering='crispEdges'></path><path d='M201.9,26.9L196.4,142.7L259.2,131.7Z' fill='rgb(255,213,115)' shape-rendering='crispEdges'></path><path d='M259.2,131.7L196.4,142.7L234.9,206.1Z' fill='rgb(254,190,74)' shape-rendering='crispEdges'></path><path d='M580.8,103L506.2,98.2L499.8,175.6Z' fill='rgb(204,131,57)' shape-rendering='crispEdges'></path><path d='M499.8,175.6L506.2,98.2L388.1,135.7Z' fill='rgb(227,139,52)' shape-rendering='crispEdges'></path><path d='M134.1,328.3L209.2,402.4L202,340.9Z' fill='rgb(202,131,60)' shape-rendering='crispEdges'></path><path d='M202,340.9L209.2,402.4L270.7,350.3Z' fill='rgb(196,120,40)' shape-rendering='crispEdges'></path><path d='M495.3,411.4L564.8,355.1L505.4,325.1Z' fill='rgb(147,50,5)' shape-rendering='crispEdges'></path><path d='M560.9,258.4L587.3,208.1L499.8,175.6Z' fill='rgb(191,94,19)' shape-rendering='crispEdges'></path><path d='M651.7,272.4L587.3,208.1L560.9,258.4Z' fill='rgb(167,75,14)' shape-rendering='crispEdges'></path><path d='M240.9,512.2L358.9,485.8L333.1,435.1Z' fill='rgb(174,90,22)' shape-rendering='crispEdges'></path><path d='M333.1,435.1L358.9,485.8L438.6,425.2Z' fill='rgb(166,73,14)' shape-rendering='crispEdges'></path><path d='M438.6,425.2L503.8,479.3L495.3,411.4Z' fill='rgb(142,51,6)' shape-rendering='crispEdges'></path><path d='M209.2,402.4L235,443.7L270.7,350.3Z' fill='rgb(177,110,38)' shape-rendering='crispEdges'></path><path d='M536.2,22.2L473.1,47.6L506.2,98.2Z' fill='rgb(217,151,93)' shape-rendering='crispEdges'></path><path d='M506.2,98.2L473.1,47.6L388.1,135.7Z' fill='rgb(232,154,79)' shape-rendering='crispEdges'></path><path d='M358.9,485.8L391.2,495.1L438.6,425.2Z' fill='rgb(162,68,12)' shape-rendering='crispEdges'></path><path d='M473.1,47.6L407.6,22.7L388.1,135.7Z' fill='rgb(242,166,94)' shape-rendering='crispEdges'></path><path d='M124.7,294.2L134.1,328.3L178.4,252.9Z' fill='rgb(237,157,80)' shape-rendering='crispEdges'></path><path d='M178.4,252.9L134.1,328.3L202,340.9Z' fill='rgb(229,147,67)' shape-rendering='crispEdges'></path><path d='M162.8,515.4L240.9,512.2L235,443.7Z' fill='rgb(177,116,46)' shape-rendering='crispEdges'></path><path d='M495.3,411.4L566.2,407.4L564.8,355.1Z' fill='rgb(126,44,6)' shape-rendering='crispEdges'></path><path d='M564.8,355.1L651.7,272.4L560.9,258.4Z' fill='rgb(155,58,7)' shape-rendering='crispEdges'></path><path d='M503.8,479.3L566.2,407.4L495.3,411.4Z' fill='rgb(128,45,6)' shape-rendering='crispEdges'></path><path d='M108.6,206.2L124.7,294.2L178.4,252.9Z' fill='rgb(250,172,89)' shape-rendering='crispEdges'></path><path d='M344.6,57.3L273.5,26.7L259.2,131.7Z' fill='rgb(255,198,110)' shape-rendering='crispEdges'></path><path d='M273,-16.7L273.5,26.7L336.7,-43.1Z' fill='rgb(255,205,139)' shape-rendering='crispEdges'></path><path d='M391.2,495.1L503.8,479.3L438.6,425.2Z' fill='rgb(152,57,7)' shape-rendering='crispEdges'></path><path d='M587.3,208.1L580.8,103L499.8,175.6Z' fill='rgb(192,115,36)' shape-rendering='crispEdges'></path><path d='M139.1,109.6L108.6,206.2L196.4,142.7Z' fill='rgb(255,211,112)' shape-rendering='crispEdges'></path><path d='M196.4,142.7L108.6,206.2L207.1,227.9Z' fill='rgb(255,189,89)' shape-rendering='crispEdges'></path><path d='M201.9,26.9L139.1,109.6L196.4,142.7Z' fill='rgb(255,222,136)' shape-rendering='crispEdges'></path><path d='M654.3,350.8L651.7,272.4L564.8,355.1Z' fill='rgb(139,50,6)' shape-rendering='crispEdges'></path><path d='M587.3,208.1L630.4,103.1L580.8,103Z' fill='rgb(177,117,48)' shape-rendering='crispEdges'></path><path d='M162.8,515.4L235,443.7L209.2,402.4Z' fill='rgb(177,118,50)' shape-rendering='crispEdges'></path><path d='M235,443.7L240.9,512.2L333.1,435.1Z' fill='rgb(176,101,30)' shape-rendering='crispEdges'></path><path d='M358.9,485.8L240.9,512.2L391.2,495.1Z' fill='rgb(172,85,19)' shape-rendering='crispEdges'></path><path d='M273,-16.7L201.9,26.9L273.5,26.7Z' fill='rgb(255,217,145)' shape-rendering='crispEdges'></path><path d='M273.5,26.7L201.9,26.9L259.2,131.7Z' fill='rgb(255,213,125)' shape-rendering='crispEdges'></path><path d='M638.2,509.9L620.1,400.3L566.2,407.4Z' fill='rgb(102,37,6)' shape-rendering='crispEdges'></path><path d='M566.2,407.4L620.1,400.3L564.8,355.1Z' fill='rgb(114,40,6)' shape-rendering='crispEdges'></path><path d='M514.5,-43.8L386.6,-31L407.6,22.7Z' fill='rgb(243,170,120)' shape-rendering='crispEdges'></path><path d='M580.8,103L536.2,22.2L506.2,98.2Z' fill='rgb(203,142,83)' shape-rendering='crispEdges'></path><path d='M514.5,-43.8L407.6,22.7L473.1,47.6Z' fill='rgb(234,163,114)' shape-rendering='crispEdges'></path><path d='M407.6,22.7L386.6,-31L344.6,57.3Z' fill='rgb(254,182,120)' shape-rendering='crispEdges'></path><path d='M336.7,-43.1L273.5,26.7L344.6,57.3Z' fill='rgb(255,198,130)' shape-rendering='crispEdges'></path><path d='M651.7,272.4L663.5,223.8L587.3,208.1Z' fill='rgb(169,79,17)' shape-rendering='crispEdges'></path><path d='M580.8,103L609.7,27.6L536.2,22.2Z' fill='rgb(190,141,92)' shape-rendering='crispEdges'></path><path d='M620.1,400.3L654.3,350.8L564.8,355.1Z' fill='rgb(118,42,6)' shape-rendering='crispEdges'></path><path d='M726.1,259.6L686.3,206L663.5,223.8Z' fill='rgb(170,81,18)' shape-rendering='crispEdges'></path><path d='M663.5,223.8L630.4,103.1L587.3,208.1Z' fill='rgb(176,102,31)' shape-rendering='crispEdges'></path><path d='M386.6,-31L336.7,-43.1L344.6,57.3Z' fill='rgb(255,189,130)' shape-rendering='crispEdges'></path><path d='M124.7,294.2L54.7,300.1L134.1,328.3Z' fill='rgb(232,157,89)' shape-rendering='crispEdges'></path><path d='M134.1,328.3L89.3,429.4L209.2,402.4Z' fill='rgb(186,132,74)' shape-rendering='crispEdges'></path><path d='M108.6,206.2L54.7,300.1L124.7,294.2Z' fill='rgb(247,172,98)' shape-rendering='crispEdges'></path><path d='M11.8,176.7L54.7,300.1L108.6,206.2Z' fill='rgb(255,190,116)' shape-rendering='crispEdges'></path><path d='M726.1,259.6L663.5,223.8L651.7,272.4Z' fill='rgb(166,72,13)' shape-rendering='crispEdges'></path><path d='M663.5,223.8L686.3,206L630.4,103.1Z' fill='rgb(176,102,31)' shape-rendering='crispEdges'></path><path d='M391.2,495.1L564.2,521.7L503.8,479.3Z' fill='rgb(139,50,6)' shape-rendering='crispEdges'></path><path d='M503.8,479.3L564.2,521.7L566.2,407.4Z' fill='rgb(120,43,6)' shape-rendering='crispEdges'></path><path d='M702,425.1L689.2,351.7L654.3,350.8Z' fill='rgb(114,41,6)' shape-rendering='crispEdges'></path><path d='M240.9,512.2L564.2,521.7L391.2,495.1Z' fill='rgb(162,68,11)' shape-rendering='crispEdges'></path><path d='M54.7,300.1L89.3,429.4L134.1,328.3Z' fill='rgb(208,146,89)' shape-rendering='crispEdges'></path><path d='M89.3,429.4L162.8,515.4L209.2,402.4Z' fill='rgb(178,127,70)' shape-rendering='crispEdges'></path><path d='M240.9,512.2L111.9,519.8L564.2,521.7Z' fill='rgb(174,91,22)' shape-rendering='crispEdges'></path><path d='M702,425.1L654.3,350.8L620.1,400.3Z' fill='rgb(106,38,6)' shape-rendering='crispEdges'></path><path d='M654.3,350.8L689.2,351.7L651.7,272.4Z' fill='rgb(139,50,6)' shape-rendering='crispEdges'></path><path d='M201.9,26.9L106.2,41.2L139.1,109.6Z' fill='rgb(255,235,163)' shape-rendering='crispEdges'></path><path d='M18.5,119.3L11.8,176.7L108.6,206.2Z' fill='rgb(255,215,137)' shape-rendering='crispEdges'></path><path d='M241.2,-79.6L164.3,-3.1L201.9,26.9Z' fill='rgb(255,230,165)' shape-rendering='crispEdges'></path><path d='M241.2,-79.6L201.9,26.9L273,-16.7Z' fill='rgb(255,221,152)' shape-rendering='crispEdges'></path><path d='M705,57.6L609.7,27.6L630.4,103.1Z' fill='rgb(180,135,86)' shape-rendering='crispEdges'></path><path d='M630.4,103.1L609.7,27.6L580.8,103Z' fill='rgb(179,132,80)' shape-rendering='crispEdges'></path><path d='M536.2,22.2L514.5,-43.8L473.1,47.6Z' fill='rgb(219,155,111)' shape-rendering='crispEdges'></path><path d='M570,-27.1L514.5,-43.8L536.2,22.2Z' fill='rgb(207,150,113)' shape-rendering='crispEdges'></path><path d='M439.5,-114.5L311.2,-75.7L336.7,-43.1Z' fill='rgb(255,187,129)' shape-rendering='crispEdges'></path><path d='M439.5,-114.5L336.7,-43.1L386.6,-31Z' fill='rgb(253,181,126)' shape-rendering='crispEdges'></path><path d='M336.7,-43.1L311.2,-75.7L273,-16.7Z' fill='rgb(255,202,137)' shape-rendering='crispEdges'></path><path d='M164.3,-3.1L106.2,41.2L201.9,26.9Z' fill='rgb(255,238,175)' shape-rendering='crispEdges'></path><path d='M686.3,206L686.9,119.5L630.4,103.1Z' fill='rgb(177,116,45)' shape-rendering='crispEdges'></path><path d='M726.1,259.6L686.9,119.5L686.3,206Z' fill='rgb(175,95,25)' shape-rendering='crispEdges'></path><path d='M609.7,27.6L570,-27.1L536.2,22.2Z' fill='rgb(194,145,109)' shape-rendering='crispEdges'></path><path d='M642.4,-47.5L570,-27.1L609.7,27.6Z' fill='rgb(183,141,110)' shape-rendering='crispEdges'></path><path d='M689.2,351.7L726.1,259.6L651.7,272.4Z' fill='rgb(153,58,7)' shape-rendering='crispEdges'></path><path d='M311.2,-75.7L241.2,-79.6L273,-16.7Z' fill='rgb(255,211,144)' shape-rendering='crispEdges'></path><path d='M164.3,-3.1L139.9,-29.7L106.2,41.2Z' fill='rgb(255,242,190)' shape-rendering='crispEdges'></path><path d='M47.6,452.4L111.9,519.8L89.3,429.4Z' fill='rgb(180,136,89)' shape-rendering='crispEdges'></path><path d='M89.3,429.4L111.9,519.8L162.8,515.4Z' fill='rgb(179,132,79)' shape-rendering='crispEdges'></path><path d='M162.8,515.4L111.9,519.8L240.9,512.2Z' fill='rgb(178,124,63)' shape-rendering='crispEdges'></path><path d='M18.5,119.3L108.6,206.2L139.1,109.6Z' fill='rgb(255,221,134)' shape-rendering='crispEdges'></path><path d='M54.7,300.1L9.7,344.5L89.3,429.4Z' fill='rgb(206,148,100)' shape-rendering='crispEdges'></path><path d='M564.2,521.7L638.2,509.9L566.2,407.4Z' fill='rgb(105,38,6)' shape-rendering='crispEdges'></path><path d='M689.2,351.7L702,425.1L726.1,259.6Z' fill='rgb(129,46,6)' shape-rendering='crispEdges'></path><path d='M241.2,-79.6L139.9,-29.7L164.3,-3.1Z' fill='rgb(255,234,174)' shape-rendering='crispEdges'></path><path d='M45.4,57.6L18.5,119.3L139.1,109.6Z' fill='rgb(255,238,170)' shape-rendering='crispEdges'></path><path d='M-9.7,287.1L9.7,344.5L54.7,300.1Z' fill='rgb(234,163,112)' shape-rendering='crispEdges'></path><path d='M638.2,509.9L702,425.1L620.1,400.3Z' fill='rgb(102,37,6)' shape-rendering='crispEdges'></path><path d='M9.7,344.5L47.6,452.4L89.3,429.4Z' fill='rgb(181,139,98)' shape-rendering='crispEdges'></path><path d='M45.4,57.6L139.1,109.6L106.2,41.2Z' fill='rgb(255,240,173)' shape-rendering='crispEdges'></path><path d='M513.2,-124.5L439.5,-114.5L514.5,-43.8Z' fill='rgb(226,159,116)' shape-rendering='crispEdges'></path><path d='M514.5,-43.8L439.5,-114.5L386.6,-31Z' fill='rgb(241,167,119)' shape-rendering='crispEdges'></path><path d='M311.2,-75.7L178,-113.2L241.2,-79.6Z' fill='rgb(255,220,151)' shape-rendering='crispEdges'></path><path d='M11.8,176.7L-9.7,287.1L54.7,300.1Z' fill='rgb(253,182,121)' shape-rendering='crispEdges'></path><path d='M-45.6,183.3L-9.7,287.1L11.8,176.7Z' fill='rgb(255,198,135)' shape-rendering='crispEdges'></path><path d='M18,-13.9L45.4,57.6L106.2,41.2Z' fill='rgb(255,250,202)' shape-rendering='crispEdges'></path><path d='M726.1,259.6L705,57.6L686.9,119.5Z' fill='rgb(176,115,44)' shape-rendering='crispEdges'></path><path d='M686.9,119.5L705,57.6L630.4,103.1Z' fill='rgb(179,129,74)' shape-rendering='crispEdges'></path><path d='M536.4,-126.6L513.2,-124.5L514.5,-43.8Z' fill='rgb(214,153,113)' shape-rendering='crispEdges'></path><path d='M536.4,-126.6L514.5,-43.8L570,-27.1Z' fill='rgb(207,150,113)' shape-rendering='crispEdges'></path><path d='M688.9,-34L642.4,-47.5L609.7,27.6Z' fill='rgb(183,141,110)' shape-rendering='crispEdges'></path><path d='M241.2,-79.6L178,-113.2L139.9,-29.7Z' fill='rgb(255,233,172)' shape-rendering='crispEdges'></path><path d='M139.9,-29.7L18,-13.9L106.2,41.2Z' fill='rgb(255,249,205)' shape-rendering='crispEdges'></path><path d='M439.5,-114.5L178,-113.2L311.2,-75.7Z' fill='rgb(255,201,137)' shape-rendering='crispEdges'></path><path d='M131,-124.4L178,-113.2L439.5,-114.5Z' fill='rgb(255,218,150)' shape-rendering='crispEdges'></path><path d='M657.2,-85.5L536.4,-126.6L570,-27.1Z' fill='rgb(188,143,111)' shape-rendering='crispEdges'></path><path d='M513.2,-124.5L131,-124.4L439.5,-114.5Z' fill='rgb(255,188,129)' shape-rendering='crispEdges'></path><path d='M638.2,509.9L725.2,482.4L702,425.1Z' fill='rgb(102,37,6)' shape-rendering='crispEdges'></path><path d='M702,425.1L725.2,482.4L726.1,259.6Z' fill='rgb(107,39,6)' shape-rendering='crispEdges'></path><path d='M-62.5,104.1L-45.6,183.3L18.5,119.3Z' fill='rgb(255,230,165)' shape-rendering='crispEdges'></path><path d='M18.5,119.3L-45.6,183.3L11.8,176.7Z' fill='rgb(255,221,152)' shape-rendering='crispEdges'></path><path d='M-62.4,329L-33.1,415.8L9.7,344.5Z' fill='rgb(205,149,112)' shape-rendering='crispEdges'></path><path d='M-62.4,329L9.7,344.5L-9.7,287.1Z' fill='rgb(229,161,116)' shape-rendering='crispEdges'></path><path d='M9.7,344.5L-33.1,415.8L47.6,452.4Z' fill='rgb(182,140,108)' shape-rendering='crispEdges'></path><path d='M47.6,452.4L22.8,527.3L111.9,519.8Z' fill='rgb(181,138,95)' shape-rendering='crispEdges'></path><path d='M705,57.6L688.9,-34L609.7,27.6Z' fill='rgb(182,140,104)' shape-rendering='crispEdges'></path><path d='M642.4,-47.5L657.2,-85.5L570,-27.1Z' fill='rgb(183,141,110)' shape-rendering='crispEdges'></path><path d='M-92.6,283L-62.4,329L-9.7,287.1Z' fill='rgb(241,167,118)' shape-rendering='crispEdges'></path><path d='M-41.6,508.7L22.8,527.3L47.6,452.4Z' fill='rgb(182,140,108)' shape-rendering='crispEdges'></path><path d='M111.9,519.8L22.8,527.3L564.2,521.7Z' fill='rgb(176,111,39)' shape-rendering='crispEdges'></path><path d='M39,-89.3L18,-13.9L139.9,-29.7Z' fill='rgb(255,251,211)' shape-rendering='crispEdges'></path><path d='M-51.2,56.1L-62.5,104.1L18.5,119.3Z' fill='rgb(255,242,190)' shape-rendering='crispEdges'></path><path d='M688.9,-34L657.2,-85.5L642.4,-47.5Z' fill='rgb(183,141,110)' shape-rendering='crispEdges'></path><path d='M536.4,-126.6L131,-124.4L513.2,-124.5Z' fill='rgb(252,180,125)' shape-rendering='crispEdges'></path><path d='M178,-113.2L131,-124.4L139.9,-29.7Z' fill='rgb(255,241,187)' shape-rendering='crispEdges'></path><path d='M-51.2,56.1L18.5,119.3L45.4,57.6Z' fill='rgb(255,245,195)' shape-rendering='crispEdges'></path><path d='M-45.6,183.3L-92.6,283L-9.7,287.1Z' fill='rgb(255,184,127)' shape-rendering='crispEdges'></path><path d='M-89.1,432L-41.6,508.7L-33.1,415.8Z' fill='rgb(183,141,110)' shape-rendering='crispEdges'></path><path d='M-103.5,176L-92.6,283L-45.6,183.3Z' fill='rgb(255,198,135)' shape-rendering='crispEdges'></path><path d='M18,-13.9L-51.2,56.1L45.4,57.6Z' fill='rgb(255,252,214)' shape-rendering='crispEdges'></path><path d='M131,-124.4L39,-89.3L139.9,-29.7Z' fill='rgb(255,247,200)' shape-rendering='crispEdges'></path><path d='M18,-13.9L-27.6,-18L-51.2,56.1Z' fill='rgb(255,254,226)' shape-rendering='crispEdges'></path><path d='M-123.3,147.5L-103.5,176L-62.5,104.1Z' fill='rgb(255,227,160)' shape-rendering='crispEdges'></path><path d='M-62.5,104.1L-103.5,176L-45.6,183.3Z' fill='rgb(255,223,154)' shape-rendering='crispEdges'></path><path d='M-33.1,415.8L-41.6,508.7L47.6,452.4Z' fill='rgb(183,141,110)' shape-rendering='crispEdges'></path><path d='M-89.1,432L-33.1,415.8L-62.4,329Z' fill='rgb(187,143,111)' shape-rendering='crispEdges'></path><path d='M39,-89.3L-27.6,-18L18,-13.9Z' fill='rgb(255,254,226)' shape-rendering='crispEdges'></path><path d='M-118.4,41.5L-123.3,147.5L-62.5,104.1Z' fill='rgb(255,241,188)' shape-rendering='crispEdges'></path><path d='M-133.7,335.4L-62.4,329L-92.6,283Z' fill='rgb(232,162,117)' shape-rendering='crispEdges'></path><path d='M-133.7,335.4L-89.1,432L-62.4,329Z' fill='rgb(203,149,112)' shape-rendering='crispEdges'></path><path d='M-118.4,41.5L-62.5,104.1L-51.2,56.1Z' fill='rgb(255,247,201)' shape-rendering='crispEdges'></path><path d='M-103.5,176L-133.7,335.4L-92.6,283Z' fill='rgb(251,179,125)' shape-rendering='crispEdges'></path><path d='M-123.3,147.5L-133.7,335.4L-103.5,176Z' fill='rgb(255,196,134)' shape-rendering='crispEdges'></path><path d='M705,57.6L708.8,-126.1L688.9,-34Z' fill='rgb(183,141,110)' shape-rendering='crispEdges'></path><path d='M688.9,-34L708.8,-126.1L657.2,-85.5Z' fill='rgb(183,141,110)' shape-rendering='crispEdges'></path><path d='M657.2,-85.5L708.8,-126.1L536.4,-126.6Z' fill='rgb(183,141,110)' shape-rendering='crispEdges'></path><path d='M726.1,259.6L708.8,-126.1L705,57.6Z' fill='rgb(180,135,86)' shape-rendering='crispEdges'></path><path d='M39,-89.3L-16.6,-108.5L-27.6,-18Z' fill='rgb(255,255,229)' shape-rendering='crispEdges'></path><path d='M-115.8,-25.3L-118.4,41.5L-51.2,56.1Z' fill='rgb(255,253,219)' shape-rendering='crispEdges'></path><path d='M131,-124.4L-16.6,-108.5L39,-89.3Z' fill='rgb(255,252,215)' shape-rendering='crispEdges'></path><path d='M-115.8,-25.3L-51.2,56.1L-27.6,-18Z' fill='rgb(255,255,227)' shape-rendering='crispEdges'></path><path d='M-123.3,147.5L-115.8,-25.3L-133.7,335.4Z' fill='rgb(255,224,155)' shape-rendering='crispEdges'></path><path d='M-133.7,335.4L-115.1,485.4L-89.1,432Z' fill='rgb(183,141,110)' shape-rendering='crispEdges'></path><path d='M-89.1,432L-115.1,485.4L-41.6,508.7Z' fill='rgb(183,141,110)' shape-rendering='crispEdges'></path><path d='M-109,-104.7L-115.8,-25.3L-27.6,-18Z' fill='rgb(255,255,229)' shape-rendering='crispEdges'></path><path d='M-118.4,41.5L-115.8,-25.3L-123.3,147.5Z' fill='rgb(255,250,207)' shape-rendering='crispEdges'></path><path d='M131,-124.4L-109,-104.7L-16.6,-108.5Z' fill='rgb(255,255,228)' shape-rendering='crispEdges'></path><path d='M-16.6,-108.5L-109,-104.7L-27.6,-18Z' fill='rgb(255,255,229)' shape-rendering='crispEdges'></path></svg>"`;


================================================
FILE: src/pattern.js
================================================
import { createCanvas } from 'canvas' // this is a simple shim in browsers
import getScalingRatio from './utils/getScalingRatio'
const isBrowser = (typeof window !== 'undefined' && typeof document !== 'undefined')
const doc = isBrowser && document

// utility for building up SVG node trees with the DOM API
const sDOM = (tagName, attrs = {}, children, existingRoot) => {
  const elem = existingRoot || doc.createElementNS('http://www.w3.org/2000/svg', tagName)
  Object.keys(attrs).forEach(
    k => attrs[k] !== undefined && elem.setAttribute(k, attrs[k])
  )
  children && children.forEach(c => elem.appendChild(c))
  return elem
}

// serialize attrs object to XML attributes. Assumes everything is already
// escaped (safe input).
const serializeAttrs = attrs => (
  Object.entries(attrs)
    .filter(([_, v]) => v !== undefined)
    .map(([k, v]) => `${k}='${v}'`)
    .join(' ')
)

// minimal XML-tree builder for use in Node
const sNode = (tagName, attrs = {}, children) => ({
  tagName,
  attrs,
  children,
  toString: () => `<${tagName} ${serializeAttrs(attrs)}>${children ? children.join('') : ''}</${tagName}>`
})

export default class Pattern {
  constructor (points, polys, opts) {
    this.points = points
    this.polys = polys
    this.opts = opts
  }

  _toSVG = (serializer, destSVG, _svgOpts = {}) => {
    const s = serializer
    const defaultSVGOptions = { includeNamespace: true, coordinateDecimals: 1 }
    const svgOpts = { ...defaultSVGOptions, ..._svgOpts }
    const { points, opts, polys } = this
    const { width, height } = opts

    // only round points if the coordinateDecimals option is non-negative
    // set coordinateDecimals to -1 to disable point rounding
    const roundedPoints = (svgOpts.coordinateDecimals < 0) ? points : points.map(
      p => p.map(x => +x.toFixed(svgOpts.coordinateDecimals))
    )

    const paths = polys.map((poly) => {
      const xys = poly.vertexIndices.map(i => `${roundedPoints[i][0]},${roundedPoints[i][1]}`)
      const d = 'M' + xys.join('L') + 'Z'
      const hasStroke = opts.strokeWidth > 0
      // shape-rendering crispEdges resolves the antialiasing issues, at the
      // potential cost of some visual degradation. For the best performance
      // *and* best visual rendering, use Canvas.
      return s('path', {
        d,
        fill: opts.fill ? poly.color.css() : undefined,
        stroke: hasStroke ? poly.color.css() : undefined,
        'stroke-width': hasStroke ? opts.strokeWidth : undefined,
        'stroke-linejoin': hasStroke ? 'round' : undefined,
        'shape-rendering': opts.fill ? 'crispEdges' : undefined
      })
    })

    const svg = s(
      'svg',
      {
        xmlns: svgOpts.includeNamespace ? 'http://www.w3.org/2000/svg' : undefined,
        width,
        height
      },
      paths,
      destSVG
    )

    return svg
  }

  toSVGTree = (svgOpts) => this._toSVG(sNode, null, svgOpts)

  toSVG = isBrowser
    ? (destSVG, svgOpts) => this._toSVG(sDOM, destSVG, svgOpts)
    : (destSVG, svgOpts) => this.toSVGTree(svgOpts)

  toCanvas = (destCanvas, _canvasOpts = {}) => {
    const defaultCanvasOptions = {
      scaling: isBrowser ? 'auto' : false,
      applyCssScaling: !!isBrowser
    }
    const canvasOpts = { ...defaultCanvasOptions, ..._canvasOpts }
    const { points, polys, opts } = this

    const canvas = destCanvas || createCanvas(opts.width, opts.height) // doc.createElement('canvas')
    const ctx = canvas.getContext('2d')

    if (canvasOpts.scaling) {
      const drawRatio = canvasOpts.scaling === 'auto'
        ? getScalingRatio(ctx)
        : canvasOpts.scaling

      if (drawRatio !== 1) {
        // set the 'real' canvas size to the higher width/height
        canvas.width = opts.width * drawRatio
        canvas.height = opts.height * drawRatio

        if (canvasOpts.applyCssScaling) {
          // ...then scale it back down with CSS
          canvas.style.width = opts.width + 'px'
          canvas.style.height = opts.height + 'px'
        }
      } else {
        // this is a normal 1:1 device: don't apply scaling
        canvas.width = opts.width
        canvas.height = opts.height
        if (canvasOpts.applyCssScaling) {
          canvas.style.width = ''
          canvas.style.height = ''
        }
      }
      ctx.scale(drawRatio, drawRatio)
    }

    const drawPoly = (poly, fill, stroke) => {
      const vertexIndices = poly.vertexIndices
      ctx.lineJoin = 'round'
      ctx.beginPath()
      ctx.moveTo(points[vertexIndices[0]][0], points[vertexIndices[0]][1])
      ctx.lineTo(points[vertexIndices[1]][0], points[vertexIndices[1]][1])
      ctx.lineTo(points[vertexIndices[2]][0], points[vertexIndices[2]][1])
      ctx.closePath()
      if (fill) {
        ctx.fillStyle = fill.color.css()
        ctx.fill()
      }
      if (stroke) {
        ctx.strokeStyle = stroke.color.css()
        ctx.lineWidth = stroke.width
        ctx.stroke()
      }
    }

    if (opts.fill && opts.strokeWidth < 1) {
      // draw background strokes at edge bounds to solve for white gaps due to
      // canvas antialiasing. See https://stackoverflow.com/q/19319963/381299
      polys.forEach(poly => drawPoly(poly, null, { color: poly.color, width: 2 }))
    }

    // draw visible fills and strokes
    polys.forEach(poly => drawPoly(
      poly,
      opts.fill && { color: poly.color },
      (opts.strokeWidth > 0) && { color: poly.color, width: opts.strokeWidth }
    ))

    return canvas
  }
}


================================================
FILE: src/trianglify.browser.test.js
================================================
/**
 * @jest-environment jsdom
 */
/* eslint-env jest */
// Because Trianglify is authored using ES modules syntax (which Rollup likes)
// it can't be unit-tested on a per-file basis using Jest without maintaining
// a separate compiler configuration for test files.
//
// In the interest of sanity, this means that instead of unit-testing Trianglify,
// I'm importing the built `dist` files and running a set of integration tests
// against the public API only.
//
// I hope to start unit-testing in the future, when native support for ES modules
// lands in Node and Jest (See https://github.com/facebook/jest/issues/9430)

// pull in the transpiled, browser-bundle version of trianglify.
// this is needed so that we get the browser-targeted Canvas shim, and
// NOT the node library
const trianglify = require('../dist/trianglify.bundle.debug.js')
const Pattern = trianglify.Pattern

describe('Public API', () => {
  test('default export should be a function', () => {
    expect(trianglify).toBeInstanceOf(Function)
  })

  test('should export the colorbrewer palette', () => {
    expect(trianglify.utils.colorbrewer).toBeDefined()
    expect(trianglify.utils.colorbrewer.YlGn).toBeDefined()
  })

  test('should export the mix utility', () => {
    expect(trianglify.utils.mix).toBeDefined()
    expect(trianglify.utils.mix).toBeInstanceOf(Function)
  })

  test('should export the color function generators', () => {
    expect(trianglify.colorFunctions.interpolateLinear).toBeDefined()
    expect(trianglify.colorFunctions.interpolateLinear).toBeInstanceOf(Function)
    expect(trianglify.colorFunctions.sparkle).toBeInstanceOf(Function)
    expect(trianglify.colorFunctions.shadows).toBeInstanceOf(Function)
  })
})

describe('Options Parsing', () => {
  test('should throw an error on unrecognized options', () => {
    expect(
      () => trianglify({ height: 100, width: 100, bad_option: true })
    ).toThrow()
  })

  test('should throw an error on invalid dimensions', () => {
    expect(
      () => trianglify({ height: 100, width: -1 })
    ).toThrow()

    expect(
      () => trianglify({ height: -1, width: 100 })
    ).toThrow()
  })
})

describe('Pattern generation', () => {
  test('return a Pattern given valid options', () => {
    expect(trianglify({ height: 100, width: 100 })).toBeInstanceOf(Pattern)
  })

  test('should use default options when invoked', () => {
    const pattern = trianglify()
    expect(pattern.opts).toEqual(trianglify.defaultOptions)
  })

  test('should override opts with user-provided options', () => {
    const pattern = trianglify({ height: 100, width: 100, cellSize: 1234 })
    expect(pattern.opts.cellSize).toEqual(1234)
  })

  test('should accept the random color option without erroring', () => {
    expect(() => {
      trianglify({ xColors: 'random' })
      trianglify({ yColors: 'random' })
    }).not.toThrow()
  })

  test('should accept the match color option without erroring', () => {
    expect(() => {
      trianglify({ xColors: 'random', yColors: 'match' })
    }).not.toThrow()
  })

  test('should accept a named colorbrewer palette without erroring', () => {
    expect(() => {
      trianglify({ xColors: 'RdBu' })
      trianglify({ yColors: 'OrRd' })
    }).not.toThrow()
  })

  test('should error on a names palette that does not exist', () => {
    expect(() => {
      trianglify({ xColors: 'Foo' })
      trianglify({ yColors: 'Bar' })
    }).toThrow()
  })

  test('should generate well-formed geometry', () => {
    const pattern = trianglify({ height: 100, width: 100, cellSize: 20 })
    // we care about pattern.points and pattern.polys here
    expect(pattern.points).toBeInstanceOf(Array)
    // assert that points is an array of [x, y] tuples
    pattern.points.forEach(point => {
      expect(point).toBeInstanceOf(Array)
      expect(point).toHaveLength(2)
    })

    // asset the polys looks right
    expect(pattern.polys).toBeInstanceOf(Array)
    pattern.polys.forEach(poly => {
      expect(poly).toBeInstanceOf(Object)
      expect(Object.keys(poly)).toEqual(['vertexIndices', 'centroid', 'color'])
    })
  })

  test('should be random by default', () => {
    const pattern1 = trianglify()
    const pattern2 = trianglify()
    expect(pattern1.toSVG()).not.toEqual(pattern2.toSVG())
  })

  test('should be deterministic when seeded', () => {
    const pattern1 = trianglify({ seed: 'deadbeef' })
    const pattern2 = trianglify({ seed: 'deadbeef' })
    expect(pattern1.toSVG()).toEqual(pattern2.toSVG())
  })

  test('should match snapshot for non-breaking version bumps', () => {
    expect(trianglify({ seed: 'snapshotText' }).toSVG()).toMatchSnapshot()
  })
})

describe('Pattern outputs in browser environment', () => {
  describe('#toSVG', () => {
    test('returns a well-formed SVG node', () => {
      const pattern = trianglify()
      const svgDOM = pattern.toSVG()
      expect(svgDOM.tagName).toEqual('svg')
      expect(svgDOM.children).toBeInstanceOf(global.HTMLCollection)
      Array.from(svgDOM.children).forEach(node => {
        expect(node.tagName).toEqual('path')
      })
      expect(svgDOM.children).toHaveLength(pattern.polys.length)
    })

    test('supports rendering to the destSVG target', () => {
      const destSVG = document.createElementNS('http://www.w3.org/2000/svg', 'svg')
      expect(destSVG.children).toHaveLength(0)
      const pattern = trianglify({ seed: 'destSVG works' })
      // side-effect-ful render to destSVG
      pattern.toSVG(destSVG)
      expect(destSVG.children).toHaveLength(pattern.polys.length)
      expect(destSVG).toMatchSnapshot()
    })
  })

  describe('#toSVGTree', () => {
    const pattern = trianglify({ seed: 'foobar' })
    const svgTree = pattern.toSVGTree()

    test('returns a synthetic tree of object literals', () => {
      expect(Object.keys(svgTree)).toEqual(['tagName', 'attrs', 'children', 'toString'])
    })

    test('serializes to an SVG string', () => {
      expect(svgTree.toString()).toMatchSnapshot()
    })
  })

  describe('#toCanvas', () => {
    test('returns a Canvas node', () => {
      const pattern = trianglify()
      const canvas = pattern.toCanvas()
      expect(canvas).toBeInstanceOf(global.HTMLElement)
      expect(canvas.tagName).toEqual('CANVAS')
      // there's not really any way to test the canvas contents here
    })
  })
})


================================================
FILE: src/trianglify.js
================================================
/*
 * Trianglify.js
 * by @qrohlf
 *
 * Licensed under the GPLv3
 */

import Delaunator from 'delaunator'
// TODO - evaluate smaller alternatives
// (chroma bloats bundle by 40k, minified)
import chroma from 'chroma-js'

import colorbrewer from './utils/colorbrewer'
import Pattern from './pattern'
import mulberry32 from './utils/mulberry32'
import * as geom from './utils/geom'
import * as colorFunctions from './utils/colorFunctions'

const defaultOptions = {
  width: 600,
  height: 400,
  cellSize: 75,
  variance: 0.75,
  seed: null,
  xColors: 'random',
  yColors: 'match',
  palette: colorbrewer,
  colorSpace: 'lab',
  colorFunction: colorFunctions.interpolateLinear(0.5),
  fill: true,
  strokeWidth: 0,
  points: null
}

// This function does the "core" render-independent work:
//
// 1. Parse and munge options
// 2. Setup cell geometry
// 3. Generate random points within cell geometry
// 4. Use the Delaunator library to run the triangulation
// 5. Do color interpolation to establish the fundamental coloring of the shapes
export default function trianglify (_opts = {}) {
  Object.keys(_opts).forEach(k => {
    if (defaultOptions[k] === undefined) {
      throw TypeError(`Unrecognized option: ${k}`)
    }
  })
  const opts = { ...defaultOptions, ..._opts }

  if (!(opts.height > 0)) {
    throw TypeError(`invalid height: ${opts.height}`)
  }
  if (!(opts.width > 0)) {
    throw TypeError(`invalid width: ${opts.width}`)
  }

  // standard randomizer, used for point gen and layout
  const rand = mulberry32(opts.seed)

  const randomFromPalette = () => {
    if (opts.palette instanceof Array) {
      return opts.palette[Math.floor(rand() * opts.palette.length)]
    }
    const keys = Object.keys(opts.palette)
    return opts.palette[keys[Math.floor(rand() * keys.length)]]
  }

  // The first step here is to set up our color scales for the X and Y axis.
  // First, munge the shortcut options like 'random' or 'match' into real color
  // arrays. Then, set up a Chroma scale in the appropriate color space.
  const processColorOpts = (colorOpt) => {
    switch (true) {
      case Array.isArray(colorOpt):
        return colorOpt
      case !!opts.palette[colorOpt]:
        return opts.palette[colorOpt]
      case colorOpt === 'random':
        return randomFromPalette()
      default:
        throw TypeError(`Unrecognized color option: ${colorOpt}`)
    }
  }

  const xColors = processColorOpts(opts.xColors)
  const yColors = opts.yColors === 'match'
    ? xColors
    : processColorOpts(opts.yColors)

  const xScale = chroma.scale(xColors).mode(opts.colorSpace)
  const yScale = chroma.scale(yColors).mode(opts.colorSpace)

  // Our next step is to generate a pseudo-random grid of {x, y} points,
  // (or to simply utilize the points that were passed to us)
  const points = opts.points || getPoints(opts, rand)

  // Once we have the points array, run the triangulation
  var geomIndices = Delaunator.from(points).triangles
  // ...and then generate geometry and color data:

  // use a different (salted) randomizer for the color function so that
  // swapping out color functions doesn't change the pattern geometry itself
  const salt = 42
  const cRand = mulberry32(opts.seed ? opts.seed + salt : null)
  const polys = []

  for (let i = 0; i < geomIndices.length; i += 3) {
    // convert shallow array-packed vertex indices into 3-tuples
    const vertexIndices = [
      geomIndices[i],
      geomIndices[i + 1],
      geomIndices[i + 2]
    ]

    // grab a copy of the actual vertices to use for calculations
    const vertices = vertexIndices.map(i => points[i])

    const { width, height } = opts
    const norm = num => Math.max(0, Math.min(1, num))
    const centroid = geom.getCentroid(vertices)
    const xPercent = norm(centroid.x / width)
    const yPercent = norm(centroid.y / height)

    const color = opts.colorFunction({
      centroid, // centroid of polygon, non-normalized
      xPercent, // x-coordinate of centroid, normalized to [0, 1]
      yPercent, // y-coordinate of centroid, normalized to [0, 1]
      vertexIndices, // vertex indices of the polygon
      vertices, // [x, y] vertices of the polygon
      xScale, // x-colors scale for the pattern
      yScale, // y-colors scale for the pattern
      points, // array of generated points for the pattern
      opts, // options used to initialize the pattern
      random: cRand // seeded randomization function for use by color functions
    })

    polys.push({
      vertexIndices,
      centroid,
      color // chroma color object
    })
  }

  return new Pattern(points, polys, opts)
}

const getPoints = (opts, random) => {
  const { width, height, cellSize, variance } = opts

  // pad by 2 cells outside the visible area on each side to ensure we fully
  // cover the 'artboard'
  const colCount = Math.floor(width / cellSize) + 4
  const rowCount = Math.floor(height / cellSize) + 4

  // determine bleed values to ensure that the grid is centered within the
  // artboard
  const bleedX = ((colCount * cellSize) - width) / 2
  const bleedY = ((rowCount * cellSize) - height) / 2

  // apply variance to cellSize to get cellJitter in pixels
  const cellJitter = cellSize * variance
  const getJitter = () => (random() - 0.5) * cellJitter

  const pointCount = colCount * rowCount

  const halfCell = cellSize / 2

  const points = Array(pointCount).fill(null).map((_, i) => {
    const col = i % colCount
    const row = Math.floor(i / colCount)

    // [x, y, z]
    return [
      -bleedX + col * cellSize + halfCell + getJitter(),
      -bleedY + row * cellSize + halfCell + getJitter()
    ]
  })

  return points
}

// tweak some of the exports here
trianglify.utils = {
  mix: chroma.mix,
  colorbrewer
}

trianglify.colorFunctions = colorFunctions
trianglify.Pattern = Pattern
trianglify.defaultOptions = defaultOptions


================================================
FILE: src/trianglify.node.test.js
================================================
/**
 * @jest-environment node
 */
/* eslint-env jest */
// Here, we test the node-specific functionality of Trianglify.
const trianglify = require('../dist/trianglify.js')
const { Canvas } = require('canvas')
const Pattern = trianglify.Pattern

describe('Pattern generation', () => {
  test('return a Pattern given valid options', () => {
    expect(trianglify({ height: 100, width: 100 })).toBeInstanceOf(Pattern)
  })

  test('should be random by default', () => {
    const pattern1 = trianglify()
    const pattern2 = trianglify()
    expect(pattern1.toSVG()).not.toEqual(pattern2.toSVG())
  })

  test('should match snapshot for non-breaking version bumps', () => {
    expect(trianglify({ seed: 'snapshotText' }).toSVG().toString()).toMatchSnapshot()
  })
})

describe('Pattern outputs in a node environment', () => {
  describe('#toSVG', () => {
    const pattern = trianglify()
    const svgTree = pattern.toSVG()

    test('returns a synthetic tree of object literals', () => {
      expect(Object.keys(svgTree)).toEqual(['tagName', 'attrs', 'children', 'toString'])
    })
  })

  describe('#toCanvas', () => {
    const pattern = trianglify()
    const canvas = pattern.toCanvas()
    test('returns a node-canvas Canvas object', () => {
      expect(canvas).toBeInstanceOf(Canvas)
      expect(canvas.createPNGStream).toBeInstanceOf(Function)
    })
  })
})


================================================
FILE: src/utils/colorFunctions.js
================================================
import chroma from 'chroma-js'
// Built in color functions provided for your convenience.
//
// Usage example:
//
// const pattern = trianglify({
//  width: 300,
//  height: 200,
//  colorFunction: trianglify.colorFunctions.sparkle(0.2)
// })
//
// the snippet above gives you a trianglify pattern with a 20% random
// jitter applied to the x and y gradient scales

// Linear interpolation of two gradients, one for the x and one for the y
// axis. This is the default Trianglify color function.
// The bias parameter controls how prevalent the y axis is versus the x axis
export const interpolateLinear = (bias = 0.5) =>
  ({ xPercent, yPercent, xScale, yScale, opts }) =>
    chroma.mix(xScale(xPercent), yScale(yPercent), bias, opts.colorSpace)

// Give the pattern a 'sparkle' effect by introducing random noise into the
// x and y gradients, making for higher contrast between cells.
export const sparkle = (jitterFactor = 0.15) =>
  ({ xPercent, yPercent, xScale, yScale, opts, random }) => {
    const jitter = () => (random() - 0.5) * jitterFactor
    const a = xScale(xPercent + jitter())
    const b = yScale(yPercent + jitter())
    return chroma.mix(a, b, 0.5, opts.colorSpace)
  }

// This is similar to the sparkle effect, but instead of swapping colors around
// it darkens cells by a random amount. The shadowIntensity parameter controls
// how dark the darkest shadows are.
export const shadows = (shadowIntensity = 0.8) => {
  return ({ xPercent, yPercent, xScale, yScale, opts, random }) => {
    const a = xScale(xPercent)
    const b = yScale(yPercent)
    const color = chroma.mix(a, b, 0.5, opts.colorSpace)
    return color.darken(shadowIntensity * random())
  }
}


================================================
FILE: src/utils/colorbrewer.js
================================================
/*
 * colorbrewer.js
 *
 * Colorbrewer colors, by Cindy Brewer
 */

export default {
  YlGn: ['#ffffe5', '#f7fcb9', '#d9f0a3', '#addd8e', '#78c679', '#41ab5d', '#238443', '#006837', '#004529'],
  YlGnBu: ['#ffffd9', '#edf8b1', '#c7e9b4', '#7fcdbb', '#41b6c4', '#1d91c0', '#225ea8', '#253494', '#081d58'],
  GnBu: ['#f7fcf0', '#e0f3db', '#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#0868ac', '#084081'],
  BuGn: ['#f7fcfd', '#e5f5f9', '#ccece6', '#99d8c9', '#66c2a4', '#41ae76', '#238b45', '#006d2c', '#00441b'],
  PuBuGn: ['#fff7fb', '#ece2f0', '#d0d1e6', '#a6bddb', '#67a9cf', '#3690c0', '#02818a', '#016c59', '#014636'],
  PuBu: ['#fff7fb', '#ece7f2', '#d0d1e6', '#a6bddb', '#74a9cf', '#3690c0', '#0570b0', '#045a8d', '#023858'],
  BuPu: ['#f7fcfd', '#e0ecf4', '#bfd3e6', '#9ebcda', '#8c96c6', '#8c6bb1', '#88419d', '#810f7c', '#4d004b'],
  RdPu: ['#fff7f3', '#fde0dd', '#fcc5c0', '#fa9fb5', '#f768a1', '#dd3497', '#ae017e', '#7a0177', '#49006a'],
  PuRd: ['#f7f4f9', '#e7e1ef', '#d4b9da', '#c994c7', '#df65b0', '#e7298a', '#ce1256', '#980043', '#67001f'],
  OrRd: ['#fff7ec', '#fee8c8', '#fdd49e', '#fdbb84', '#fc8d59', '#ef6548', '#d7301f', '#b30000', '#7f0000'],
  YlOrRd: ['#ffffcc', '#ffeda0', '#fed976', '#feb24c', '#fd8d3c', '#fc4e2a', '#e31a1c', '#bd0026', '#800026'],
  YlOrBr: ['#ffffe5', '#fff7bc', '#fee391', '#fec44f', '#fe9929', '#ec7014', '#cc4c02', '#993404', '#662506'],
  Purples: ['#fcfbfd', '#efedf5', '#dadaeb', '#bcbddc', '#9e9ac8', '#807dba', '#6a51a3', '#54278f', '#3f007d'],
  Blues: ['#f7fbff', '#deebf7', '#c6dbef', '#9ecae1', '#6baed6', '#4292c6', '#2171b5', '#08519c', '#08306b'],
  Greens: ['#f7fcf5', '#e5f5e0', '#c7e9c0', '#a1d99b', '#74c476', '#41ab5d', '#238b45', '#006d2c', '#00441b'],
  Oranges: ['#fff5eb', '#fee6ce', '#fdd0a2', '#fdae6b', '#fd8d3c', '#f16913', '#d94801', '#a63603', '#7f2704'],
  Reds: ['#fff5f0', '#fee0d2', '#fcbba1', '#fc9272', '#fb6a4a', '#ef3b2c', '#cb181d', '#a50f15', '#67000d'],
  Greys: ['#ffffff', '#f0f0f0', '#d9d9d9', '#bdbdbd', '#969696', '#737373', '#525252', '#252525', '#000000'],
  PuOr: ['#7f3b08', '#b35806', '#e08214', '#fdb863', '#fee0b6', '#f7f7f7', '#d8daeb', '#b2abd2', '#8073ac', '#542788', '#2d004b'],
  BrBG: ['#543005', '#8c510a', '#bf812d', '#dfc27d', '#f6e8c3', '#f5f5f5', '#c7eae5', '#80cdc1', '#35978f', '#01665e', '#003c30'],
  PRGn: ['#40004b', '#762a83', '#9970ab', '#c2a5cf', '#e7d4e8', '#f7f7f7', '#d9f0d3', '#a6dba0', '#5aae61', '#1b7837', '#00441b'],
  PiYG: ['#8e0152', '#c51b7d', '#de77ae', '#f1b6da', '#fde0ef', '#f7f7f7', '#e6f5d0', '#b8e186', '#7fbc41', '#4d9221', '#276419'],
  RdBu: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#f7f7f7', '#d1e5f0', '#92c5de', '#4393c3', '#2166ac', '#053061'],
  RdGy: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#ffffff', '#e0e0e0', '#bababa', '#878787', '#4d4d4d', '#1a1a1a'],
  RdYlBu: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee090', '#ffffbf', '#e0f3f8', '#abd9e9', '#74add1', '#4575b4', '#313695'],
  Spectral: ['#9e0142', '#d53e4f', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#e6f598', '#abdda4', '#66c2a5', '#3288bd', '#5e4fa2'],
  RdYlGn: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#d9ef8b', '#a6d96a', '#66bd63', '#1a9850', '#006837']
}


================================================
FILE: src/utils/debugRender.js
================================================
export const debugRender = (opts, points) => {
  const doc = window.document
  const svg = window.document.createElementNS('http://www.w3.org/2000/svg', 'svg')
  svg.setAttribute('width', opts.width + 400)
  svg.setAttribute('height', opts.height + 400)

  points.forEach(p => {
    const circle = doc.createElementNS('http://www.w3.org/2000/svg', 'circle')
    circle.setAttribute('cx', p[0])
    circle.setAttribute('cy', p[1])
    circle.setAttribute('r', 2)
    svg.appendChild(circle)
  })

  const bounds = doc.createElementNS('http://www.w3.org/2000/svg', 'rect')
  bounds.setAttribute('x', 0)
  bounds.setAttribute('y', 0)
  bounds.setAttribute('width', opts.width)
  bounds.setAttribute('height', opts.height)
  bounds.setAttribute('stroke-width', 1)
  bounds.setAttribute('stroke', 'blue')
  bounds.setAttribute('fill', 'none')
  svg.appendChild(bounds)

  svg.setAttribute('viewBox', `-100 -100 ${opts.width + 200} ${opts.height + 200}`)
  return svg
}


================================================
FILE: src/utils/geom.js
================================================
// Given an array of coordinates representing a triangle, find the centroid
// of the triangle and return it as an {x, y} object
// Accepts a single [[x, y], [x, y], [x, y]] argument
export const getCentroid = d => {
  return {
    x: (d[0][0] + d[1][0] + d[2][0]) / 3,
    y: (d[0][1] + d[1][1] + d[2][1]) / 3
  }
}

export const getTopmostVertexIndex = (vertexIndices, points) => (
  vertexIndices.reduce(
    (topmost, i) => (points[i][1] < points[topmost][1] ? i : topmost),
    vertexIndices[0]
  )
)


================================================
FILE: src/utils/getScalingRatio.js
================================================
export default function (ctx) {
  // adapted from https://gist.github.com/callumlocke/cc258a193839691f60dd
  const backingStoreRatio = (
    ctx.webkitBackingStorePixelRatio ||
    ctx.mozBackingStorePixelRatio ||
    ctx.msBackingStorePixelRatio ||
    ctx.oBackingStorePixelRatio ||
    ctx.backingStorePixelRatio || 1
  )

  const devicePixelRatio = (typeof window !== 'undefined' && window.devicePixelRatio) || 1
  const drawRatio = devicePixelRatio / backingStoreRatio
  return drawRatio
}


================================================
FILE: src/utils/mulberry32.js
================================================
// Fast seeded RNG adapted from the public-domain implementation
// by @byrc: https://github.com/bryc/code/blob/master/jshash/PRNGs.md
//
// Usage:
// const randFn = mulberry32('string seed')
// const randomNumber = randFn() // [0, 1] random float
export default function mulberry32 (seed) {
  if (!seed) { seed = Math.random().toString(36) } // support no-seed usage
  var a = xmur3(seed)()
  return function () {
    a |= 0; a = a + 0x6D2B79F5 | 0
    var t = Math.imul(a ^ a >>> 15, 1 | a)
    t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t
    return ((t ^ t >>> 14) >>> 0) / 4294967296
  }
}

function xmur3 (str) {
  for (var i = 0, h = 1779033703 ^ str.length; i < str.length; i++) {
    h = Math.imul(h ^ str.charCodeAt(i), 3432918353)
    h = h << 13 | h >>> 19
  }
  return function () {
    h = Math.imul(h ^ h >>> 16, 2246822507)
    h = Math.imul(h ^ h >>> 13, 3266489909)
    return (h ^= h >>> 16) >>> 0
  }
}
Download .txt
gitextract_0pzmxqqx/

├── .babelrc
├── .browserslistrc
├── .github/
│   └── workflows/
│       └── build.yml
├── .gitignore
├── .nvmrc
├── CONTRIBUTING.md
├── LICENSE
├── Readme.md
├── changelog.txt
├── examples/
│   ├── basic-web-example.html
│   ├── color-function-example.html
│   ├── custom-points-example.html
│   ├── destsvg-example.html
│   ├── save-as-png.js
│   ├── save-as-svg.js
│   └── transparency-example.html
├── package.json
├── rollup.config.js
└── src/
    ├── __snapshots__/
    │   ├── trianglify.browser.test.js.snap
    │   └── trianglify.node.test.js.snap
    ├── pattern.js
    ├── trianglify.browser.test.js
    ├── trianglify.js
    ├── trianglify.node.test.js
    └── utils/
        ├── colorFunctions.js
        ├── colorbrewer.js
        ├── debugRender.js
        ├── geom.js
        ├── getScalingRatio.js
        └── mulberry32.js
Download .txt
SYMBOL INDEX (5 symbols across 3 files)

FILE: src/pattern.js
  class Pattern (line 33) | class Pattern {
    method constructor (line 34) | constructor (points, polys, opts) {

FILE: src/trianglify.js
  function trianglify (line 42) | function trianglify (_opts = {}) {

FILE: src/utils/mulberry32.js
  function mulberry32 (line 7) | function mulberry32 (seed) {
  function xmur3 (line 18) | function xmur3 (str) {
Condensed preview — 30 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (186K chars).
[
  {
    "path": ".babelrc",
    "chars": 107,
    "preview": "{\n  \"plugins\": [\"@babel/plugin-proposal-class-properties\"],\n  \"presets\": [\n    [\"@babel/preset-env\"]\n  ]\n}\n"
  },
  {
    "path": ".browserslistrc",
    "chars": 58,
    "preview": "defaults\nnot IE 11\nnot IE_Mob 11\nmaintained node versions\n"
  },
  {
    "path": ".github/workflows/build.yml",
    "chars": 539,
    "preview": "name: build\n\non:\n  push:\n    branches: [ master ]\n  pull_request:\n    branches: [ master ]\n    types: [synchronize]\n\njob"
  },
  {
    "path": ".gitignore",
    "chars": 18,
    "preview": "node_modules\ndist\n"
  },
  {
    "path": ".nvmrc",
    "chars": 4,
    "preview": "v12\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 1008,
    "preview": "# Contributing Guidelines\n\nPull requests and issues are welcome! For all contributions, please:\n\n1. Read the [Readme](Re"
  },
  {
    "path": "LICENSE",
    "chars": 32472,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "Readme.md",
    "chars": 10579,
    "preview": "# Trianglify\n\n\nTrianglify is a library that I wrote to generate nice SVG background images like this one:\n\n![](https://c"
  },
  {
    "path": "changelog.txt",
    "chars": 700,
    "preview": "v4\n- ground-up port to ES2015\n- support for node-canvas 2.6\n- comprehensive test suite\n- support for rendering wireframe"
  },
  {
    "path": "examples/basic-web-example.html",
    "chars": 1437,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE="
  },
  {
    "path": "examples/color-function-example.html",
    "chars": 3966,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE="
  },
  {
    "path": "examples/custom-points-example.html",
    "chars": 1292,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE="
  },
  {
    "path": "examples/destsvg-example.html",
    "chars": 1139,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE="
  },
  {
    "path": "examples/save-as-png.js",
    "chars": 607,
    "preview": "// Basic command-line example\n// Usage: node save-as-png.js\nvar fs = require('fs')\nvar trianglify = require('../dist/tri"
  },
  {
    "path": "examples/save-as-svg.js",
    "chars": 420,
    "preview": "// Basic command-line example\n// Usage: node save-as-svg.js\nvar fs = require('fs')\nvar trianglify = require('../dist/tri"
  },
  {
    "path": "examples/transparency-example.html",
    "chars": 2889,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\">\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE="
  },
  {
    "path": "package.json",
    "chars": 1699,
    "preview": "{\n  \"name\": \"trianglify\",\n  \"version\": \"4.1.1\",\n  \"description\": \"Trianglify is a javascript library for generating colo"
  },
  {
    "path": "rollup.config.js",
    "chars": 1242,
    "preview": "import commonjs from '@rollup/plugin-commonjs'\nimport resolve from '@rollup/plugin-node-resolve'\nimport babel from '@rol"
  },
  {
    "path": "src/__snapshots__/trianglify.browser.test.js.snap",
    "chars": 69343,
    "preview": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Pattern generation should match snapshot for non-breaking version b"
  },
  {
    "path": "src/__snapshots__/trianglify.node.test.js.snap",
    "chars": 21417,
    "preview": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Pattern generation should match snapshot for non-breaking version b"
  },
  {
    "path": "src/pattern.js",
    "chars": 5471,
    "preview": "import { createCanvas } from 'canvas' // this is a simple shim in browsers\nimport getScalingRatio from './utils/getScali"
  },
  {
    "path": "src/trianglify.browser.test.js",
    "chars": 6355,
    "preview": "/**\n * @jest-environment jsdom\n */\n/* eslint-env jest */\n// Because Trianglify is authored using ES modules syntax (whic"
  },
  {
    "path": "src/trianglify.js",
    "chars": 5860,
    "preview": "/*\n * Trianglify.js\n * by @qrohlf\n *\n * Licensed under the GPLv3\n */\n\nimport Delaunator from 'delaunator'\n// TODO - eval"
  },
  {
    "path": "src/trianglify.node.test.js",
    "chars": 1369,
    "preview": "/**\n * @jest-environment node\n */\n/* eslint-env jest */\n// Here, we test the node-specific functionality of Trianglify.\n"
  },
  {
    "path": "src/utils/colorFunctions.js",
    "chars": 1689,
    "preview": "import chroma from 'chroma-js'\n// Built in color functions provided for your convenience.\n//\n// Usage example:\n//\n// con"
  },
  {
    "path": "src/utils/colorbrewer.js",
    "chars": 3253,
    "preview": "/*\n * colorbrewer.js\n *\n * Colorbrewer colors, by Cindy Brewer\n */\n\nexport default {\n  YlGn: ['#ffffe5', '#f7fcb9', '#d9"
  },
  {
    "path": "src/utils/debugRender.js",
    "chars": 964,
    "preview": "export const debugRender = (opts, points) => {\n  const doc = window.document\n  const svg = window.document.createElement"
  },
  {
    "path": "src/utils/geom.js",
    "chars": 506,
    "preview": "// Given an array of coordinates representing a triangle, find the centroid\n// of the triangle and return it as an {x, y"
  },
  {
    "path": "src/utils/getScalingRatio.js",
    "chars": 495,
    "preview": "export default function (ctx) {\n  // adapted from https://gist.github.com/callumlocke/cc258a193839691f60dd\n  const backi"
  },
  {
    "path": "src/utils/mulberry32.js",
    "chars": 921,
    "preview": "// Fast seeded RNG adapted from the public-domain implementation\n// by @byrc: https://github.com/bryc/code/blob/master/j"
  }
]

About this extraction

This page contains the full source code of the qrohlf/trianglify GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 30 files (173.7 KB), approximately 64.4k tokens, and a symbol index with 5 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!