Skip to content

Incorrect documentation: overload for background() #8697

@bensgilbert

Description

@bensgilbert

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions