Skip to content

Instantly share code, notes, and snippets.

@andybell
Created December 3, 2019 18:55
Show Gist options
  • Save andybell/b063098a245fa3188d308a50ee4878fe to your computer and use it in GitHub Desktop.
Save andybell/b063098a245fa3188d308a50ee4878fe to your computer and use it in GitHub Desktop.
Blindside make .clr
# make value to rgb colormap for blindside data packing
minValue = 905
maxValue = 552674
mod = 256
with open('fullrgb_values.clr', 'w') as fullclr:
for i in range(minValue, maxValue+1):
value = i
blue = i % mod
green = (i//mod) % mod
red = ((i//mod)//mod) % mod
line = f'{value} {red} {green} {blue}'
print(line)
fullclr.write(line + '\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment