September 23, 2024, 08:29:52 AM

1,531,320 Posts in 46,731 Topics by 1,523 Members
› View the most recent posts on the forum.


an obligatory thread in times of inactivity: CTRL+V (or command+V)

Started by Samus Aran, August 06, 2009, 08:09:57 PM

previous topic - next topic

0 Members and 1 Guest are viewing this topic.

Go Down

Samus Aran

In case you're retarded, that means paste. Real men use keyboard shortcuts, though. So yeah, paste.

<rand> loves <pokemon>, but <rand> has a hard-on for <pokemon> because it will <pokemove> him all night long if you know what I mean.

It's from IRC.  :3



Sync


StarPilot


Placebo Headwound



Daddy

Code Select
color1 = input("Input Color 1: ")
color2 = input("Input Color 2: ")
r1,g1,b1 = '0'*(6-len(color1[0:2])) + color1[0:2], '0'*(6-len(color1[2:4])) + color1[2:4], '0'*(6-len(color1[4:6])) + color1[4:6]
r2,g2,b2 = '0'*(6-len(color2[0:2])) + color2[0:2], '0'*(6-len(color2[2:4])) + color2[2:4], '0'*(6-len(color2[4:6])) + color2[4:6]
r1,g1,b1 = int(r1,16), int(g1,16), int(b1,16)
r2,g2,b2 = int(r2,16), int(g2,16), int(b2,16)
rList = []
gList = []
bList = []
fullHexList = []
#Red
if r1 > r2:
rStep = round((r1-r2)/5)
for i in range(5):
rList.append(r2+rStep)
r2+=rStep
else:
rStep = round((r2-r1)/5)
for i in range(5):
rList.append(r2-rStep)
r2-=rStep
#Green
if g1 > g2:
gStep = round((g1-g2)/5)
for i in range(5):
gList.append(g2+gStep)
g2+=gStep
else:
gStep = round((g2-g1)/5)
for i in range(5):
gList.append(g2-gStep)
g2-=gStep
#Blue
if b1 > b2:
bStep = round((b1 - b2)/5)
for i in range(5):
bList.append(b2+bStep)
b2+=bStep
else:
bStep = round((b2 - b1)/5)
for i in range(5):
bList.append(b2-bStep)
b2-=bStep

for i in range(5):
rHex = '0' *(2- len(str(hex(rList[i]))[2:4])) + str(hex(rList[i]))[2:4]
gHex = '0' *(2- len(str(hex(gList[i]))[2:4])) + str(hex(gList[i]))[2:4]
bHex = '0' *(2- len(str(hex(bList[i]))[2:4])) + str(hex(bList[i]))[2:4]
fullHexList.append(rHex + gHex + bHex)
for color in fullHexList: print(color)


I had to put it in code tags since it breaks boyah.   
      

Placebo Headwound

Quote from: Prowling Kewn on August 06, 2009, 08:43:43 PM

I had to put it in code tags since it breaks boyah.   
      
Can't you use a spoiler tag? doodhuh;

strongbad

Bethany Evangelical Free Church

No idea my mom used the computer last

Hiro

Uhh it was some email address I've never heard of, so no.  >.<


Classic




Daddy

Quote from: Placebo Headwound on August 06, 2009, 08:47:29 PM
Can't you use a spoiler tag? doodhuh;
No, because the code would still cause errors because the lists used.

Go Up