Title: Added hsb() and rgb() helper functions by brownian-motion · Pull Request #6021 · processing/processing · GitHub
Open Graph Title: Added hsb() and rgb() helper functions by brownian-motion · Pull Request #6021 · processing/processing
X Title: Added hsb() and rgb() helper functions by brownian-motion · Pull Request #6021 · processing/processing
Description: When using Processing, I frequently find myself wanting to create a color with a specific hue, saturation, or brightness while in RGB mode. For example, when creating random colors, I often found myself writing something like: color c = color(255 * (float) Math.random(), 255 * (float) Math.random(), 255 * (float) Math.random()); but this produces bright and dark colors, as well as vibrant and dull colors. What I really wanted was a color with a random hue, like so: color c = hsv(255 * (float) Math.random(), 200, 200); but frequently had to achieve this by "switching modes" halfway through a program: colorMode(HSV); color c = color(255 * (float) Math.random(), 200, 200); colorMode(RGB); This PR adds the helper functions I've wanted for so long, to be able to create an arbitrary color in either color space, without having to switch color modes before/after the call.
Open Graph Description: When using Processing, I frequently find myself wanting to create a color with a specific hue, saturation, or brightness while in RGB mode. For example, when creating random colors, I often found m...
X Description: When using Processing, I frequently find myself wanting to create a color with a specific hue, saturation, or brightness while in RGB mode. For example, when creating random colors, I often found m...
Opengraph URL: https://github.com/processing/processing/pull/6021
X: @github
Domain: patch-diff.githubusercontent.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:d7d1eb17-cb34-e413-ecd7-e754e4d99d20 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 88E0:2000F3:D1D89E:126E4A7:696F6EF6 |
| html-safe-nonce | e9e17831529bcbc84bcc4ac54ad1bc58a4f5eecfb9b9e85ba3082f136c49e368 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OEUwOjIwMDBGMzpEMUQ4OUU6MTI2RTRBNzo2OTZGNkVGNiIsInZpc2l0b3JfaWQiOiI1MjU4Nzc0NzYwOTAzMzcyNTM0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | a8fefa3f3b6ef409e7dda5c80ee9e0c701a0bbc040070cd0e555161ba23d0c89 |
| hovercard-subject-tag | pull_request:402249834 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/processing/processing/pull/6021/files |
| twitter:image | https://avatars.githubusercontent.com/u/9982062?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/9982062?s=400&v=4 |
| og:image:alt | When using Processing, I frequently find myself wanting to create a color with a specific hue, saturation, or brightness while in RGB mode. For example, when creating random colors, I often found m... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | acc7f8c2e144976eeb6e7a73826049dd183bc572ccf5eaa9afb8265c617a97ab |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/processing/processing git https://github.com/processing/processing.git |
| octolytics-dimension-user_id | 1617169 |
| octolytics-dimension-user_login | processing |
| octolytics-dimension-repository_id | 7807399 |
| octolytics-dimension-repository_nwo | processing/processing |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7807399 |
| octolytics-dimension-repository_network_root_nwo | processing/processing |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cc546a224d6d4726a8d7c3a0dfe0cf65dbf9b7bd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width