processing / processing/p5.js

Incorrect documentation: overload for `background()`

Open
#8,697 6 comments 1 reaction 1 assignee View on GitHub

@VaibhavNarayann is already working on this.

Since Jun 10, 2026.

Area:Color Bug
Dominant language
JavaScript
Stars
24k
Forks
3.8k
Avg merge
3d 16h
Merged PRs (30d)
25

Description

Most appropriate sub-area of p5.js?
  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • p5.strands
  • WebGL
  • DevOps, Build process, Unit testing
  • Internationalization (i18n)
  • Friendly Errors
  • Other (specify if possible)
p5.js version

No response

Web browser and version

No response

Operating system

No response

Steps to reproduce this

https://discord.com/channels/836700474425475088/837760254229610586/1489098098683678851
https://p5js.org/reference/p5/background/

the docs state an overload for background() is:
background(colorstring, [a])
where:

colorstring
String: color string, possible formats include: integer rgb() or rgba(), percentage rgb() or rgba(), 3-digit hex, 6-digit hex.
a
Number: opacity of the background relative to current color range (default is 0-255).

which would imply this would work:
background('#222222', 127);
yet it doesn't

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.