Skip to content

fill() bug in p5.Geometry -> strange alpha behaviourย #6539

@acamposuribe

Description

@acamposuribe

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build Process
  • Unit Testing
  • Internalization
  • Friendly Errors
  • Other (specify if possible)

p5.js version

1.8

Web browser and version

No response

Operating System

No response

Steps to reproduce this

There is a strange behaviour with fill() calls within the buildGeometry() function or between beginGeometry() and endGeometry(). I've found two problems:

  1. Alpha/opacity bug: when trying to fill with translucent colors, the background is white rather than transparent. For alpha = 0, the shapes fill with white [1,1,1,1] rather than transparent background
  2. Bugged fill() behaviour: if you call fill() only once, the fill color is ignored

I've created this sketch to show both problems:

Snippet:

Sample in p5 online editor

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    DONE! ๐ŸŽ‰

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions