-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from brittni-and-the-polar-bear/22-create-basi…
…c-color-classes 22 create basic color classes
- Loading branch information
Showing
32 changed files
with
978 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,11 @@ package-lock.json | |
|
||
# generated files | ||
out/ | ||
dist/ | ||
zip/ | ||
|
||
# jest | ||
tests-coverage/ | ||
|
||
# WebStorm | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (C) 2023 Brittni Watkins. | ||
* | ||
* This file is a part of brittni and the polar bear's Generative Art Project Template, | ||
* which is released under the GNU Affero General Public License, Version 3.0. | ||
* You may not use this file except in compliance with the license. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. See LICENSE or go to | ||
* https://www.gnu.org/licenses/agpl-3.0.en.html for full license details. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU Affero General Public License for more details. | ||
*/ | ||
|
||
import { sketch } from "sketch"; | ||
import { Color } from "common"; | ||
|
||
sketch.draw = (): void => { | ||
sketch.background(0, 255, 255); | ||
sketch.rectMode(sketch.CENTER); | ||
|
||
const colorA: Color = new Color(sketch, sketch.color(255)); | ||
sketch.fill(colorA.color); | ||
sketch.rect(0, 0, 250, 250); | ||
|
||
const colorB: Color = new Color(sketch); | ||
sketch.fill(colorB.color); | ||
sketch.rect(0, 0, 75, 75); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright (C) 2023 Brittni Watkins. | ||
* | ||
* This file is a part of brittni and the polar bear's Generative Art Project Template, | ||
* which is released under the GNU Affero General Public License, Version 3.0. | ||
* You may not use this file except in compliance with the license. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. See LICENSE or go to | ||
* https://www.gnu.org/licenses/agpl-3.0.en.html for full license details. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU Affero General Public License for more details. | ||
*/ | ||
|
||
import type { JestConfigWithTsJest } from 'ts-jest'; | ||
|
||
const config: JestConfigWithTsJest = { | ||
collectCoverage: true, | ||
coverageDirectory: './out/tests-coverage', | ||
coverageReporters: ['text', 'lcov'], | ||
errorOnDeprecated: true, | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'mjs', 'cjs', 'json', 'node'], | ||
moduleNameMapper: { | ||
'^assets': '<rootDir>/assets', | ||
'^color$': '<rootDir>/src/common/color', | ||
'^color/factory$': '<rootDir>/src/common/color/factory', | ||
'^p5-lib$': '<rootDir>/src/common/p5', | ||
'^random$': '<rootDir>/src/common/random', | ||
'^range$': '<rootDir>/src/common/range', | ||
'^common$': '<rootDir>/src/common' | ||
}, | ||
testEnvironment: 'jsdom', | ||
testRegex: '/tests/.*\\.(test|spec)?\\.(ts|tsx)$', | ||
transform: {'^.+\\.(ts|tsx)$': 'ts-jest'}, | ||
verbose: true | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# | ||
# Copyright (C) 2023 Brittni Watkins. | ||
# | ||
# This file is a part of brittni and the polar bear's Generative Art Project Template, | ||
# which is released under the GNU Affero General Public License, Version 3.0. | ||
# You may not use this file except in compliance with the license. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. See LICENSE or go to | ||
# https://www.gnu.org/licenses/agpl-3.0.en.html for full license details. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
# See the GNU Affero General Public License for more details. | ||
# | ||
|
||
while getopts d: flag | ||
do | ||
case "${flag}" in | ||
d) dev=${OPTARG};; | ||
*) dev="false";; | ||
esac | ||
done | ||
|
||
echo 'Starting the /examples/color/color-grid.ts example.'; | ||
|
||
echo '(1/2): Removing old output'; | ||
|
||
sh ./scripts/delete-out.sh | ||
|
||
if [ "$dev" == "true" ] | ||
then | ||
echo '(2/2): Building project and starting development server'; | ||
rollup --config --input ./examples/color/color-grid.ts --watch; | ||
else | ||
echo '(2/2): Building project'; | ||
rollup --config --input ./examples/color/color-grid.ts; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# Copyright (C) 2023 Brittni Watkins. | ||
# | ||
# This file is a part of brittni and the polar bear's Generative Art Project Template, | ||
# which is released under the GNU Affero General Public License, Version 3.0. | ||
# You may not use this file except in compliance with the license. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. See LICENSE or go to | ||
# https://www.gnu.org/licenses/agpl-3.0.en.html for full license details. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
# See the GNU Affero General Public License for more details. | ||
# | ||
|
||
echo 'Removing /out/dist'; | ||
|
||
rm -r ./out/dist; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# | ||
# Copyright (C) 2023 Brittni Watkins. | ||
# | ||
# This file is a part of brittni and the polar bear's Generative Art Project Template, | ||
# which is released under the GNU Affero General Public License, Version 3.0. | ||
# You may not use this file except in compliance with the license. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. See LICENSE or go to | ||
# https://www.gnu.org/licenses/agpl-3.0.en.html for full license details. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
# See the GNU Affero General Public License for more details. | ||
# | ||
|
||
|
||
echo 'Removing all output files.' | ||
|
||
sh ./scripts/delete-dist.sh; | ||
sh ./scripts/delete-zip.sh; | ||
sh ./scripts/delete-tests-coverage.sh; | ||
|
||
echo 'Removing /out'; | ||
|
||
rm -r ./out; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# Copyright (C) 2023 Brittni Watkins. | ||
# | ||
# This file is a part of brittni and the polar bear's Generative Art Project Template, | ||
# which is released under the GNU Affero General Public License, Version 3.0. | ||
# You may not use this file except in compliance with the license. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. See LICENSE or go to | ||
# https://www.gnu.org/licenses/agpl-3.0.en.html for full license details. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
# See the GNU Affero General Public License for more details. | ||
# | ||
|
||
echo 'Removing /out/tests-coverage'; | ||
|
||
rm -r ./out/tests-coverage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# Copyright (C) 2023 Brittni Watkins. | ||
# | ||
# This file is a part of brittni and the polar bear's Generative Art Project Template, | ||
# which is released under the GNU Affero General Public License, Version 3.0. | ||
# You may not use this file except in compliance with the license. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. See LICENSE or go to | ||
# https://www.gnu.org/licenses/agpl-3.0.en.html for full license details. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
# See the GNU Affero General Public License for more details. | ||
# | ||
|
||
echo 'Removing /out/zip'; | ||
|
||
rm -r ./out/zip; |
Oops, something went wrong.