Skip to content

Instantly share code, notes, and snippets.

@kriegsman
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kriegsman/728af6f67a6f689b81a1 to your computer and use it in GitHub Desktop.
Save kriegsman/728af6f67a6f689b81a1 to your computer and use it in GitHub Desktop.
hsv2rgb_raw_kasper
hsv2rgb_raw_kasper 'total numeric light output' data.
This data is somewhat similar to the output of traditional hsv2rgb
algorithms, such as the one described on wikipedia, or Adafruit's
color "wheel" function. In this model, blended hues requiring a mix
of LEDs (e.g, aqua, hue=96, output=510) output almost twice as much
light as primary hues that use just one LED, (e.g. blue, hue=128,
output=255). This can result in the blended hues appearing brighter
than primary hues. In the case of Aqua, this algorithm turns the
Green LED on to 254 AND the Blue LED on to 254: two LEDs on at full power.
For contrast, what this algorithm does for a primary color (eg Blue), is
turn only just the Blue LED on to 255: just ONE LED on at full power.
I continue to suspect that the 'perceptually uniform' mixing algorithm
is neither exactly this one (the 'traditional' algorithm), nor the
FastLEDv2.1 (constant-numeric-light-output) algorithm, but somewhere
in the middle; this is because I suspect that "252,0,0" does not have
the same perceptual brightness as "126,126,0", even though they have
the same numeric sum.
hue: 0 16 32 48 64 80 96 112 128 144 160 176
sat val
--- ---
255 255 255 382 510 382 255 382 510 382 255 382 510 382
255 223 223 334 446 334 223 334 446 334 223 334 446 334
255 191 191 286 382 286 191 286 382 286 191 286 382 286
255 159 159 238 318 238 159 238 318 238 159 238 318 238
255 127 127 190 254 190 127 190 254 190 127 190 254 190
255 95 95 142 190 142 95 142 190 142 95 142 190 142
255 63 63 94 126 94 63 94 126 94 63 94 126 94
255 31 31 46 62 46 31 46 62 46 31 46 62 46
223 255 317 429 541 429 317 429 541 429 317 429 541 429
223 223 277 375 473 375 277 375 473 375 277 375 473 375
223 191 237 321 405 321 237 321 405 321 237 321 405 321
223 159 197 267 337 267 197 267 337 267 197 267 337 267
223 127 157 213 269 213 157 213 269 213 157 213 269 213
223 95 117 159 201 159 117 159 201 159 117 159 201 159
223 63 77 105 133 105 77 105 133 105 77 105 133 105
223 31 37 51 65 51 37 51 65 51 37 51 65 51
191 255 381 477 573 477 381 477 573 477 381 477 573 477
191 223 333 417 501 417 333 417 501 417 333 417 501 417
191 191 285 357 429 357 285 357 429 357 285 357 429 357
191 159 237 297 357 297 237 297 357 297 237 297 357 297
191 127 189 237 285 237 189 237 285 237 189 237 285 237
191 95 141 177 213 177 141 177 213 177 141 177 213 177
191 63 93 117 141 117 93 117 141 117 93 117 141 117
191 31 45 57 69 57 45 57 69 57 45 57 69 57
159 255 445 525 605 525 445 525 605 525 445 525 605 525
159 223 389 459 529 459 389 459 529 459 389 459 529 459
159 191 333 393 453 393 333 393 453 393 333 393 453 393
159 159 277 327 377 327 277 327 377 327 277 327 377 327
159 127 221 261 301 261 221 261 301 261 221 261 301 261
159 95 165 195 225 195 165 195 225 195 165 195 225 195
159 63 109 129 149 129 109 129 149 129 109 129 149 129
159 31 53 63 73 63 53 63 73 63 53 63 73 63
127 255 509 573 637 573 509 573 637 573 509 573 637 573
127 223 445 501 557 501 445 501 557 501 445 501 557 501
127 191 381 429 477 429 381 429 477 429 381 429 477 429
127 159 317 357 397 357 317 357 397 357 317 357 397 357
127 127 253 285 317 285 253 285 317 285 253 285 317 285
127 95 189 213 237 213 189 213 237 213 189 213 237 213
127 63 125 141 157 141 125 141 157 141 125 141 157 141
127 31 61 69 77 69 61 69 77 69 61 69 77 69
95 255 573 621 669 621 573 621 669 621 573 621 669 621
95 223 501 543 585 543 501 543 585 543 501 543 585 543
95 191 429 465 501 465 429 465 501 465 429 465 501 465
95 159 357 387 417 387 357 387 417 387 357 387 417 387
95 127 285 309 333 309 285 309 333 309 285 309 333 309
95 95 213 231 249 231 213 231 249 231 213 231 249 231
95 63 141 153 165 153 141 153 165 153 141 153 165 153
95 31 69 75 81 75 69 75 81 75 69 75 81 75
63 255 637 669 701 669 637 669 701 669 637 669 701 669
63 223 557 585 613 585 557 585 613 585 557 585 613 585
63 191 477 501 525 501 477 501 525 501 477 501 525 501
63 159 397 417 437 417 397 417 437 417 397 417 437 417
63 127 317 333 349 333 317 333 349 333 317 333 349 333
63 95 237 249 261 249 237 249 261 249 237 249 261 249
63 63 157 165 173 165 157 165 173 165 157 165 173 165
63 31 77 81 85 81 77 81 85 81 77 81 85 81
31 255 701 717 733 717 701 717 733 717 701 717 733 717
31 223 613 627 641 627 613 627 641 627 613 627 641 627
31 191 525 537 549 537 525 537 549 537 525 537 549 537
31 159 437 447 457 447 437 447 457 447 437 447 457 447
31 127 349 357 365 357 349 357 365 357 349 357 365 357
31 95 261 267 273 267 261 267 273 267 261 267 273 267
31 63 173 177 181 177 173 177 181 177 173 177 181 177
31 31 85 87 89 87 85 87 89 87 85 87 89 87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment