-
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.
* a few major changes - remove install functions - move stuff around - group getters and setters together and such - fix bugs - make things shorter - rename Meal.error to Meal.need * update colour test * update limit test * add meal test
- Loading branch information
Showing
4 changed files
with
136 additions
and
137 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 |
---|---|---|
@@ -1,15 +1,16 @@ | ||
Elements.install(this) | ||
const { Colour } = Elements | ||
|
||
let teal = new Colour('cmy', 255, 75, 100) | ||
teal.s = 0.5 | ||
teal.l = 0.5 | ||
console.log('teal', teal.hsl) | ||
// a nice looking teal colour tbh | ||
document.body.style.backgroundColor = `rgba(${teal.r}, ${teal.g}, ${teal.b}, ${teal.a})` | ||
document.body.style.backgroundColor = teal.toHex() | ||
|
||
let peach = new Colour(teal) | ||
peach.r = 255 | ||
console.log('peach', peach.hsl) | ||
console.log('peach', peach.rgb) | ||
// a cute peach colour lmao | ||
document.body.style.backgroundColor = `rgba(${peach.r}, ${peach.g}, ${peach.b}, ${peach.a})` | ||
document.body.style.backgroundColor = peach.toRGB() | ||
|
||
|
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 |
---|---|---|
@@ -1,8 +1,18 @@ | ||
Elements.install(this) | ||
const { Limit } = Elements | ||
|
||
console.log(Limit.sigmoid(-Infinity, 0, 1)) // 0 | ||
console.log(Limit.sigmoid(0, 0, 1)) // 0.11920... | ||
console.log(Limit.sigmoid(0, 0, 1)) // 0.1192... | ||
console.log(Limit.sigmoid(0.5, 0, 1)) // 0.5 | ||
console.log(Limit.sigmoid(1, 0, 1)) // 0.88079... | ||
console.log(Limit.sigmoid(1, 0, 1)) //0.8807... | ||
console.log(Limit.sigmoid(Infinity, 0, 1)) // 1 | ||
|
||
|
||
|
||
const bound = new Limit(0, 0.123) | ||
|
||
console.log(bound.sigmoid(-Infinity)) | ||
console.log(bound.sigmoid(0)) | ||
console.log(bound.sigmoid(0.5)) | ||
console.log(bound.sigmoid(1)) | ||
console.log(bound.sigmoid(Infinity)) | ||
// should all be the same |
Oops, something went wrong.