mirror of
https://github.com/kou029w/pucchinglgl.git
synced 2025-01-18 16:18:00 +00:00
create pallet
This commit is contained in:
parent
e3be64d253
commit
9d54c18876
2 changed files with 6 additions and 3 deletions
4
src/config/pallet.ts
Normal file
4
src/config/pallet.ts
Normal file
|
@ -0,0 +1,4 @@
|
|||
/** 使用する色コードの配列 */
|
||||
const pallet = ["red", "green", "blue", "cyan", "magenta", "yellow"];
|
||||
|
||||
export default pallet;
|
|
@ -12,6 +12,7 @@ import {
|
|||
import randomInt from "./randomInt";
|
||||
import keyPosition from "./keyPosition";
|
||||
import keyLayouts from "./config/keyLayouts";
|
||||
import pallet from "./config/pallet";
|
||||
|
||||
const root = document.body;
|
||||
const scene = new Scene();
|
||||
|
@ -37,9 +38,7 @@ function drawRect() {
|
|||
const [intersect] = raycaster.intersectObjects(panels);
|
||||
if (!intersect) return;
|
||||
|
||||
const c16s = ["red", "green", "blue", "cyan", "magenta", "yellow"];
|
||||
const c16 = c16s[randomInt(c16s.length - 1)];
|
||||
const color = new Color(c16);
|
||||
const color = pallet[randomInt(pallet.length - 1)];
|
||||
const geometry = new PlaneGeometry(1, 1);
|
||||
const material = new MeshBasicMaterial({ color });
|
||||
const mesh = new Mesh(geometry, material);
|
||||
|
|
Loading…
Add table
Reference in a new issue