Skip to content

to_hex method#29

Open
yohann84L wants to merge 3 commits intoplotly:masterfrom
yohann84L:to_hex_method
Open

to_hex method#29
yohann84L wants to merge 3 commits intoplotly:masterfrom
yohann84L:to_hex_method

Conversation

@yohann84L
Copy link

As asked in #14. Added a to_hex() method for conversion from RGB, HSL, numeric to HEX string.


if s_t == 'hex':
return scale
elif s_t == 'numeric':

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that could be elif s_t in ['numeric', 'rgb', 'hsl']

for s in scale:
s = s[s.find("(")+1:s.find(")")].replace(' ','').split(',')
numeric_scale.append( ( float(s[0]), float(s[1]), float(s[2]) ) )
elif s_t == 'hsl':

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the rgb and hsl behaviour need to diverge now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants