Skip to content

Replace Trisurf color functions with colors.py #570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 16, 2016
Merged

Conversation

Kully
Copy link
Contributor

@Kully Kully commented Sep 14, 2016

No description provided.

@Kully Kully changed the title Replace colors in tools Replace Trisurf color functions with colors.py Sep 14, 2016
@Kully
Copy link
Contributor Author

Kully commented Sep 14, 2016

@theengineear Finally!


There are three basic types of color types: rgb, hex and tuple:

rgb - An rgb color is a string of the form 'rgb(a,b,c)' where a, b and c are
floats between 0 and 255 inclusive.
integers between 0 and 255 inclusive.
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 nice attention to detail!

@theengineear
Copy link
Contributor

General comment, could you add more documentation about scale, rgb_components, and color_scales?

@Kully
Copy link
Contributor Author

Kully commented Sep 14, 2016

General comment, could you add more documentation about scale, rgb_components, and color_scales?

Sure!

@Kully
Copy link
Contributor Author

Kully commented Sep 14, 2016

color_scales?

Can you point me to color_scales?

@theengineear
Copy link
Contributor

Sorry. i think I meant color_list?

@Kully
Copy link
Contributor Author

Kully commented Sep 14, 2016

@theengineear


if isinstance(colors, str):
if colors in PLOTLY_SCALES:
return
elif 'rgb' in colors or '#' in colors:
colors_list = [colors]
colors_list.append(colors)
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh man, this is super confusing to me... colors sounds like an array. So what's going on with appending an array to an array? So colors_list ends up being a 2d array?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haha, I should be more clear...

The user inputs colors as either a singleton color (i.e. 'rgb(x,y,z)', '#xxyyzz' or (x,y,z)) or an iterable (tuple, list) of these color types. I'm just ensuring here that if a singleton is given, that it's put inside a list so the script can iterate through the list and validate.

I'll add a :param description of colors in the String Docs if that helps

@Kully
Copy link
Contributor Author

Kully commented Sep 15, 2016

@theengineear When you get a chance. I hope things are more clear now. I added a #comment as well

@Kully
Copy link
Contributor Author

Kully commented Sep 16, 2016

@theengineear

@Kully
Copy link
Contributor Author

Kully commented Sep 16, 2016

@theengineear Now? :)

@theengineear
Copy link
Contributor

theengineear commented Sep 16, 2016

image

I did not know this image existed! A little Prince-esque for some reason! ☔

@Kully Kully merged commit 88fe0ce into master Sep 16, 2016
@Kully Kully deleted the replace_colors_in_tools branch September 16, 2016 18:51
@jonmmease jonmmease mentioned this pull request Sep 22, 2018
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