Skip to content
This repository was archived by the owner on Dec 22, 2024. It is now read-only.

Commit d2a4e46

Browse files
committed
Initial commit.
0 parents  commit d2a4e46

35 files changed

+1706
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

.github/workflows/check.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Check
2+
3+
on:
4+
# Post-submit.
5+
push:
6+
branches: [ main ]
7+
8+
# Pre-submit.
9+
pull_request:
10+
branches: [ main ]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/[email protected]
17+
- uses: dart-lang/[email protected]
18+
- uses: actions/setup-node@v4
19+
- uses: browser-actions/setup-chrome@v1
20+
- run: dart pub get
21+
- run: dart format --output none --set-exit-if-changed .
22+
- run: dart analyze
23+
- run: dart test
24+
- run: ./chore coverage -- -P coverage
25+
- name: Upload coverage
26+
uses: coverallsapp/[email protected]
27+
with:
28+
github-token: ${{ secrets.GITHUB_TOKEN }}
29+
path-to-lcov: coverage/lcov.info

.github/workflows/deploy.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Deploy
2+
3+
on:
4+
# Post-submit.
5+
push:
6+
branches: [ main ]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/[email protected]
13+
- uses: dart-lang/[email protected]
14+
- run: dart pub get
15+
- name: Build API Docs
16+
run: ./chore dartdoc
17+
- name: Deploy to GitHub Pages
18+
uses: peaceiris/actions-gh-pages@v4
19+
with:
20+
github_token: ${{ secrets.GITHUB_TOKEN }}
21+
publish_dir: ./doc/api

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.dart_tool/
2+
coverage/
3+
doc/api/
4+
pubspec.lock

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"dart-code.dart-code"
4+
]
5+
}

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
## 0.1.0
4+
5+
- Initial release.

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2024 Matan Lurey
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Mirage
2+
3+
Generates noise and patterns algorithmically for use in software, textures, and graphics.
4+
5+
![Mirage on pub.dev][pub_img]][pub_url]
6+
[![Code coverage][cov_img]][cov_url]
7+
[![Github action status][gha_img]][gha_url]
8+
[![Dartdocs][doc_img]][doc_url]
9+
[![Style guide][sty_img]][sty_url]
10+
11+
[pub_url]: https://pub.dartlang.org/packages/chaos
12+
[pub_img]: https://img.shields.io/pub/v/mirage.svg
13+
[gha_url]: https://github.com/matanlurey/mirage.dart/actions
14+
[gha_img]: https://github.com/matanlurey/mirage.dart/actions/workflows/check.yaml/badge.svg
15+
[cov_url]: https://coveralls.io/github/matanlurey/mirage.dart?branch=main
16+
[cov_img]: https://coveralls.io/repos/github/matanlurey/mirage.dart/badge.svg?branch=main
17+
[doc_url]: https://www.dartdocs.org/documentation/chaos/latest
18+
[doc_img]: https://img.shields.io/badge/Documentation-mirage-blue.svg
19+
[sty_url]: https://pub.dev/packages/oath
20+
[sty_img]: https://img.shields.io/badge/style-oath-9cf.svg
21+
22+
## Usage
23+
24+
An example of generating a Simplex noise pattern:
25+
26+
![Simlex](./example/out/simplex_noise.png)
27+
28+
```dart
29+
import 'package:mirage/mirage.dart';
30+
31+
void main() {
32+
final noise = Simplex();
33+
for (var y = 0; y < 256; y++) {
34+
for (var x = 0; x < 256; x++) {
35+
final value = noise.get2d(x / 256, y / 256);
36+
// Do something with the value...
37+
}
38+
}
39+
}
40+
```
41+
42+
For a full example, see the [example](./example) directory.
43+
44+
## Features
45+
46+
- Full implementations of popular 2D noise functions.
47+
- Simple and predictable API for generating noise patterns.
48+
- Build your own generator functions with the `Pattern2d` interface.
49+
- Thoughtfully tested and documented for ease of use.
50+
51+
## Contributing
52+
53+
To run the tests, run:
54+
55+
```shell
56+
dart test
57+
```
58+
59+
To check code coverage locally, run:
60+
61+
```shell
62+
./chore coverage
63+
```
64+
65+
To preview `dartdoc` output locally, run:
66+
67+
```shell
68+
./chore dartodc
69+
```

analysis_options.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Format: https://dart.dev/tools/analysis#the-analysis-options-file.
2+
3+
include: package:oath/strict.yaml

chore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env sh
2+
3+
# Chore is a tiny task runner with some pre-defined commands.
4+
5+
set -e
6+
7+
GIT_URL="https://github.com/matanlurey/chore.dart.git"
8+
GIT_REF="8b252e7"
9+
10+
# Silently activate the pinned version of `chore.dart` from GitHub.
11+
# Only print if there is an error.
12+
dart pub global activate -sgit $GIT_URL --git-ref=$GIT_REF 2>&1 > /dev/null
13+
14+
# Now run and forward arguments and the output.
15+
dart pub global run chore "$@"

0 commit comments

Comments
 (0)