p5实现彩色尖峰波浪线效果代码

代码语言:html

所属分类:其他

代码描述:p5实现彩色尖峰波浪线效果代码

代码标签: p5 彩色 尖峰 波浪线

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">

<style>
body {
	background: #0C181E;
}

 canvas {
      display: block; /* Remove inline spacing around the canvas */
      width: 100vw; /* Full viewport width */
      height: 100vh; /* Full viewport height (optional) */
    }
</style>

</head>
<body>

<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/p5.0.7.2.js"></script>
      <script >
function setup() {
  createCanvas(windowWidth, windowHeight); // Use window dimensions for the canvas size
  noLoop();
}

function draw() {
  background('#0C181E'); // Set the background to black

  // Define the exact color palette from the image
  let colors = [
    '#D90416', '#998DFD', '#A62991', '#F2B705', '#FDBBFB', 
    '#A4A884', '#FEB99B', '#DFEFF7', '#FF00FF', '#0C181E'
  ];

  let noiseOffset = 0; // Initialize noise offset
  let randomOffsets = []; // Store random offsets for each .........完整代码请登录后点击上方下载按钮下载查看

网友评论0