Invert Gradient with George

A forum dedicated to George scripting questions
Post Reply
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

Invert Gradient with George

Post by Mads Juul »

I use this Key Command Key : Gradient Invert.

Is it somehow possible to do this with George?
-Mads
User avatar
ZigOtto
Posts: 4102
Joined: 17 Feb 2006, 22:50
Location: south-Petazonia

Re: Invert Gradient with George

Post by ZigOtto »

if your current gradient is only between 2 colors (from A to B),
you can invert it with this little script :

Code: Select all

param none

tv_RangeGrab 0
parse result Ra Ba Ga Aa

tv_RangeGrab 255
parse result Rz Bz Gz Az

tv_RangeSet 0 Rz Bz Gz Az

tv_RangeSet 15 Ra Ba Ga Aa
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

Re: Invert Gradient with George

Post by Mads Juul »

it could work but it seems to my to be buggy
this code

Code: Select all

tv_RangeSet 255 0 0 0 255
tv_RangeGrab 255
tv_warn result
warn "0 0 0 0"
where it should warn "0 0 0 255"
This must be a bug or am I missing something?
-Mads
User avatar
ZigOtto
Posts: 4102
Joined: 17 Feb 2006, 22:50
Location: south-Petazonia

Re: Invert Gradient with George

Post by ZigOtto »

madsjuul wrote:it could work but it seems to my to be buggy
this code

Code: Select all

tv_RangeSet 255 0 0 0 255
tv_RangeGrab 255
tv_warn result
warn "0 0 0 0"
where it should warn "0 0 0 255"
This must be a bug or am I missing something?
-Mads
try with :
tv_RangeSet 15 0 0 0 255

it looks like for tv_RangeGrab, the position is from 0 to 255,
but for tv_RangeSet the position is from 0 to 15
( ... old code, only 16 positions, because 16 colors max can be set to define the gradient)
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

Re: Invert Gradient with George

Post by Mads Juul »

Thank you Zigotto. It works! :D
Post Reply