#295 More Consistent RGB Behavior

closed-works-for-me
nobody
None
5
2011-05-31
2011-05-31
Douglas
No

So this came up today and it really irked me: I wonder if this can be addressed. When using "fc rgb", you can follow with "var" (if you're in plot mode) which uses the integer function rgb(r,g,b), or a color name, or a hexadecimal string. But if I want to just set a rectangle with a color using the integer function rgb(r,g,b), there is no way to do this unless I use plot mode. Example:

rgb(r,g,b) = int(r*255)*65536 + int(g*255)*256 + int(b*255)
color = sprintf("#%u",rgb(0.999,0.999,0.999))
set label color at graph 0.5, 0.5 front
#color = rgb(1,1,1)
set obj rect from graph 0, 0 to graph 1,1 fc rgb color front
plot 1 w l

I have no functions that allow me to convert rgb values to a hexadecimal value, at least not in gnuplot. In any case, unless some function can be provided, I wish there was a way to use the rgb integer function to set the fill color of a "set obj rect"

Discussion

  • Ethan Merritt
    Ethan Merritt
    2011-05-31

    • status: open --> closed-works-for-me
     
  • Ethan Merritt
    Ethan Merritt
    2011-05-31

    rgb(r,g,b) = int(r*255)*65536 + int(g*255)*256 + int(b*255)
    color(rgb) = sprintf("#%x",rgb(r,g,b))
    set obj rect from graph 0, 0 to graph 1,1 fc rgb color(1,1,1) front