Skip to content

Commit

Permalink
Function to convert a hex code to real RGB values
Browse files Browse the repository at this point in the history
  • Loading branch information
blenderskool committed Feb 12, 2017
1 parent 7d93aba commit b789bcd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,12 @@ def rgb_to_hex(rgb):
fin = tuple(fin)
return '#%02x%02x%02x' % fin

def hex_to_real_rgb(value):
"""Return (red, green, blue) for the color given as #rrggbb."""
value = value.lstrip('#')
lv = len(value)
return list(int(value[i:i + lv // 3], 16) for i in range(0, lv, lv // 3))

def Spectrum_Engine():
"""Generates the Color Palettes. Use the PaletteGenerate Class for Palettes, as this requires some custom properties"""
kaleidoscope_spectrum_props = bpy.context.scene.kaleidoscope_spectrum_props
Expand Down

0 comments on commit b789bcd

Please sign in to comment.