2

Many Visualisation libraries and languages provide easy ways of generating any color. for example you could simple add a style tag with a css color code to set the color of an object in html.

Is there a similiar way to set the color of a pyx drawing to any wanted color code instead of the predefined pyx color codes?

(for example something like color.code = #1122DD instead of color.rgb.blue)

Sina Mansour L.
  • 418
  • 4
  • 8

2 Answers2

2

Here is the way I found as the most convenient to have a simple RGB color:

pyx.color.rgb(r,g,b)

where r, g, b are numbers in the range [0, 1] and set the percentage of each base color in RGB format.

Sina Mansour L.
  • 418
  • 4
  • 8
1

PyX provides several color schemes for defining colors, if you want to use RGB as a hex string you can provide it as: pyx.color.rgbfromhexstring("#1122DD").

zwer
  • 24,943
  • 3
  • 48
  • 66