Gnuplot RGB alpha线型和大整数问题
我正在尝试使用Gnuplot RGB alpha线型和大整数问题,gnuplot,Gnuplot,我正在尝试使用gnuplot创建透明颜色的自定义调色板: a=127 rgb(i,a)=int(255*256**(i%3)+(i/3)*96*256**((i+1)%3)+a*256**3) 然后我确实获得了所需的颜色: plot x w l lc rgb rgb(0,a) lw 32, x+1 w l lc rgb rgb(1,a) lw 32 问题,如果a等于或大于128,int返回一个负数,该负数将无法识别为颜色。有没有办法在gnuplot中获取无符号int?或者以任何其他方式将数字
gnuplot
创建透明颜色的自定义调色板:
a=127
rgb(i,a)=int(255*256**(i%3)+(i/3)*96*256**((i+1)%3)+a*256**3)
然后我确实获得了所需的颜色:
plot x w l lc rgb rgb(0,a) lw 32, x+1 w l lc rgb rgb(1,a) lw 32
问题,如果
a
等于或大于128,int
返回一个负数,该负数将无法识别为颜色。有没有办法在gnuplot中获取无符号int?或者以任何其他方式将数字理解为超出#8000000?的十六进制数使用运算符左移无符号使用运算符左移无符号
### create your own transparent palette
reset session
# a,r,g,b should be integers between 0 and 255 (or 0x00 and 0xff)
a = 127 # transparency
r = 0xff # red
g = 0x00 # green
b = 0x00 # blue
myColor(a,r,g,b) = (a<<24) + (r<<16) + (g<<8) + b
# put some objects in the background to demonstrate transparency
set object 1 rect from -7,0 to -3,250 fs solid 1.0 fc rgb "green" behind
set object 2 rect from 3,0 to 7,250 fs solid 1.0 fc rgb "blue" behind
plot for [a=0:250:10] a w l lw 5 lc rgb myColor(a,r,g,b) notitle
### end of code