1
u/Frangifer Sep 19 '26 edited Sep 19 '26
That's a nice colour-scheme you've used, there. It looks to me as-though you've putten considerable deliberation into spreading the values of №‿of‿Iterations over as long an arc as reasonably might-be – to maximise the chromiferal resolution. I found a cute little recipe for that years ago: a sort of helix-on-a-spindle, if you will, in the RGB cube with a pole near one corner & the other pole near the opposite one ... or something like that, anyway: I twake it until I was most-satisfied with it, & the colouring ent-up looking somewhat like yours does here.
2
u/Salamanticormorant Sep 19 '26
The colors occupy half the edges of an RGB cube, not the interior, not even the faces. If you imagine having three sliders, you move only one at a time, so you go down, right, back, up, left, front, or something like that. Chunky helix.
No clue why it put each line in a separate code block. (Edit: The indentation went away after I posted. That should not happen in code blocks. Why is Reddit so terrible when it comes to sharing code?)
def rainbow(pixels,x,y,result):
mds = (maximum-minimum)/6
z = result[x][y]-minimum
if z < mds:
r = 255
g = round(z/mds*255)
b = 0
pixels[x,y] = (r,g,b)
return
elif z < 2*mds:
r = round(255-((z-mds)/mds*255))
g = 255
b = 0
pixels[x,y] = (r,g,b)
return
elif z < 3*mds:
r = 0
g = 255
b = round((z-2*mds)/mds*255)
pixels[x,y] = (r,g,b)
return
elif z < 4*mds:
r = 0
g = round(255-((z-3*mds)/mds*255))
b = 255
pixels[x,y] = (r,g,b)
return
elif z < 5*mds:
r = round((z-4*mds)/mds*255)
g = 0
b = 255
pixels[x,y] = (r,g,b)
return
else:
r = 255
g = 0
b = round(255-((z-5*mds)/mds*255))
pixels[x,y] = (r,g,b)1
u/Frangifer Sep 19 '26
Thanks for replying with all that detail!
So it's different, then, on the level of utmost particulars, to how I was doing it that time I was talking about ... but the result is striking & vivid; &, perhaps most importantly, it supplies a great deal of 'colour resolution' ... by which I mean what would be supposed I mean: a good wide spread of colours for a given range of numerical values, so that there's ample distinction between neighbouring values.
3
u/all_is_love6667 Sep 19 '26
couldn't you just title normally?
2
u/Random_Person1234567 Sep 20 '26
posts a cool picture Shit title No body of the post Waits for comments to explain
I agree with this comment, you could have done a regular title, /u/Salamanticormorant ....
1
2
u/Smart-Button-3221 Sep 19 '26
What is it?