Update nekonicos_stuff.js

This commit is contained in:
Nekonico 2024-12-25 15:43:55 -08:00 committed by GitHub
parent f1e55759fb
commit a44a971caa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 87 additions and 1 deletions

View File

@ -2,6 +2,92 @@ behaviors.SOLIDIFY = function(pixel) {
pixel.solid = true
}
var colorOne = "#ffffff"
var colorTwo = "#000000"
viewInfo[8] = { // Neon View
name: "neon",
pixel: function(pixel,ctx) {
if (elements[pixel.element].isColor === true) {
var color = pixel.gradient;
if (color < 0) {color = 0}
if (color > 60) {color = 60}
// logarithmic scale, with coldest being 225 (-50 degrees) and hottest being 0 (6000 degrees)
var hue = Math.round(225 - (Math.log(color)/Math.log(60))*225);
if (hue < 0) {hue = 0}
if (hue > 225) {hue = 225}
drawSquare(ctx,"hsl("+hue+",50%,50%)",pixel.x,pixel.y)
}
}
}
elements.red = {
color: "#AD1300",
behavior: [
"XX|XX|XX",
"XX|XX|XX",
"XX|XX|XX",
],
tool: function(pixel) {
if (elements[pixel.element].isColor == true) {
pixel.gradient += 1
}
},
canPlace: false,
category: "tools",
}
elements.colorOne = {
tick: function(pixel) {
if (pixel.color != colorOne) {
pixel.color = colorOne
}
if (pixel.gradient > 0) {
pixel.gradient -= 1
}
},
properties: {
gradient: 0,
},
isColor: true,
category: "special"
}
elements.colorTwo = {
tick: function(pixel) {
if (pixel.color != colorTwo) {
pixel.color = colorTwo
}
},
properties: {
gradient: 0,
},
isColor: true,
category: "special"
}
elements.colorTwo_controller = {
color: "#36397A",
grain: 0,
tick: function(pixel) {
if (pixel.color != colorTwo) {
colorTwo = pixel.color
}
},
category: "special"
}
elements.colorOne_controller = {
color: "#9e4839",
grain: 0,
tick: function(pixel) {
if (pixel.color != colorOne) {
colorOne = pixel.color
}
},
category: "special"
}
elements.corn_starch = {
color: ["#f5f5f1","#f2f3ee","#fcfdfc"],
behavior: behaviors.POWDER,
@ -329,4 +415,4 @@ elements.graphite_dust = {
state: "solid",
density: 1830,
stain: 0.5
}
}