Grasshopper

algorithmic modeling for Rhino

Does anyone know how to convert RGB to hexidecimal format in grasshopper?

Thanks in advance,

Zach

Views: 1216

Replies to This Discussion

Hi Zachary,

are "hexadecimal" like HTML colors, for example #89ABCDE?
If so, then something like this:

A = System.Drawing.ColorTranslator.ToHtml(color);

will do. However, to avoid HTML known colors, you need to use the ToArgb() method. Full example provided also in Python.
Did you need also the alpha channel?


- Giulio
_______________
giulio@mcneel.com

Attachments:

Damn you Giulio! 38 seconds!

--

David Rutten

david@mcneel.com

Poprad, Slovakia

:)

Usually I find answers are just given right at the moment when I'm finished with them.

- Giulio
_______________
giulio@mcneel.com

System.Drawing.ColorTranslator.ToHtml()

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Attachments:

Hey Thanks guys, I needed the Alpha Channel too, but I figured it out based on what I saw. I chose to do it in python because that is what I am familiar with. Thanks for the quick responses! I tell you what, as far as online forums go, it doesn't get better than this!

Zach

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service