Git Product home page Git Product logo

p5-raised-canvas's Introduction

p5-Raised-Canvas

An image of a drop shadow with the words "A simple drop shadow canvas for p5"

This is a simple p5 extension to make raised canvases in P5, giving sketches a bit more depth.

How to Use

  1. Include the RaisedCanvas.js in the index page
  2. Create any global variable that references RaisedCanvas(), var canv = RaisedCanvas()
  3. Fill the RaisedCanvas() with parameters to your liking.

Parameters

Parameters for this script go in this order, the only necessary ones are the first three. There are default behaviors for the rest.

  • (float) width - the real width of the canvas
  • (float) height - the real height of the canvas
  • (float) buffer - the buffer around the canvas that you will draw on
  • (vector) light direction - the direction of the shadow, defaults towards the bottom right
  • (color) background color - the color of the background, defaults to white
  • (color) foreground color - the color of the raised foreground canvas, defaults to grey
  • (color) shadow color - the color of the shadow, defaults to a mid black
  • (int) blur amount - how much blur to use, defaults to 1. *be aware things will slow down at higher numbers
  • (bool) use mouse - whether to use the mouse or not to update the light direction
  • (bool) clear background - whether or not to clear the background

Sketch Example Code

The basics of how to use this are in the sketch.js

Happy sketching!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.