Title: `stroke()` does not handle float values correctly · Issue #132 · processing/libprocessing · GitHub
Open Graph Title: `stroke()` does not handle float values correctly · Issue #132 · processing/libprocessing
X Title: `stroke()` does not handle float values correctly · Issue #132 · processing/libprocessing
Description: stroke() appears to mis-handle float inputs. When using floats (e.g. 150.0), the rendered color is incorrect Expected behavior Float values in the same range as integers should produce identical results, as in Processing. Actual behavior...
Open Graph Description: stroke() appears to mis-handle float inputs. When using floats (e.g. 150.0), the rendered color is incorrect Expected behavior Float values in the same range as integers should produce identical re...
X Description: stroke() appears to mis-handle float inputs. When using floats (e.g. 150.0), the rendered color is incorrect Expected behavior Float values in the same range as integers should produce identical re...
Opengraph URL: https://github.com/processing/libprocessing/issues/132
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`stroke()` does not handle float values correctly","articleBody":"`stroke()` appears to mis-handle float inputs. When using floats (e.g. `150.0`), the rendered color is incorrect\n\n### Expected behavior\n\nFloat values in the same range as integers should produce identical results, as in Processing.\n\n### Actual behavior\n\n* `stroke(150)` → correct grayscale\n* `stroke(150.0)` → renders as white\n\n### Reproduction (mewnala)\n\n```python\nfrom mewnala import *\n\ndef setup():\n size(640, 360)\n background(255)\n\ndef draw():\n stroke(150.0)\n line(0, 0, width, height)\n line(width, 0, 0, height)\n\n stroke(155.0, 100.0, 0.0)\n line(0, height // 2, width, height // 2)\n line(width // 2, 0, width // 2, height)\n\nrun()\n```\n\u003cimg width=\"1193\" height=\"460\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/7951e216-b9fb-45fc-8926-e3e64af171dd\" /\u003e\n\n### Equivalent Processing sketch (works as expected)\n\n```java\nvoid setup() {\n size(640, 360);\n background(255);\n}\n\nvoid draw() {\n stroke(150.0);\n line(0, 0, width, height);\n line(width, 0, 0, height);\n\n stroke(155.0, 100.0, 0.0);\n line(0, height/2, width, height/2);\n line(width/2, 0, width/2, height);\n}\n```\n\u003cimg width=\"1437\" height=\"711\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/bb027675-d27a-46a9-92cf-37026fa785cb\" /\u003e","author":{"url":"https://github.com/SableRaf","@type":"Person","name":"SableRaf"},"datePublished":"2026-04-24T14:54:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/132/libprocessing/issues/132"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:af093927-7b25-7afe-93ed-ec209e8b50e0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C07C:2B9CDD:6427B4B:87BC963:6A5E1778 |
| html-safe-nonce | ca7c45b0d817659c121af27c2b5addc4420c2687bb7257374aea1cc87f8bfc0f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMDdDOjJCOUNERDo2NDI3QjRCOjg3QkM5NjM6NkE1RTE3NzgiLCJ2aXNpdG9yX2lkIjoiODI2MjA2NzAyOTYwOTk0NDk1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e449eac67757ba519e3393439ea30adda27da32db6213be3119375e1b32a80e8 |
| hovercard-subject-tag | issue:4323737364 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/processing/libprocessing/132/issue_layout |
| twitter:image | https://opengraph.githubassets.com/214129dbec3725f6bfc328564e2686d53908e225746e015f3888c6f457518684/processing/libprocessing/issues/132 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/214129dbec3725f6bfc328564e2686d53908e225746e015f3888c6f457518684/processing/libprocessing/issues/132 |
| og:image:alt | stroke() appears to mis-handle float inputs. When using floats (e.g. 150.0), the rendered color is incorrect Expected behavior Float values in the same range as integers should produce identical re... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SableRaf |
| hostname | github.com |
| expected-hostname | github.com |
| None | d4a572b82dcecf0667243946ab33171fae36ea3b282a90c368cd553220df258f |
| turbo-cache-control | no-preview |
| go-import | github.com/processing/libprocessing git https://github.com/processing/libprocessing.git |
| octolytics-dimension-user_id | 1617169 |
| octolytics-dimension-user_login | processing |
| octolytics-dimension-repository_id | 1101329545 |
| octolytics-dimension-repository_nwo | processing/libprocessing |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1101329545 |
| octolytics-dimension-repository_network_root_nwo | processing/libprocessing |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f2da5f89a14df1202295f828eac9035e3a4d2b2b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width