#How can I generate gradients programatically?

1 messages · Page 1 of 1 (latest)

frank kindle
#

I want to achieve the effect one gets when going crazy with color curves in an image editor (as shown in the attached scrrenshot).

I already found a way to remap the colors in a similar way, but it is pretty tedious, because I have to create and adjust the gradients manually in the editor.

What I want is to generate a random gradient with say 8 grayscale steps within it. It would be even nicer if I could have the colors in this gradient fiddle around according to a perlin function.

Do you guys know of any way to do all this in TiXL?

acoustic aspen
#

did you try [BuildGradient], [DefineGradient], [BlendGradients] or [DefineIqGradient] ?

#

also @iron imp just posted a really interesting operator called ColorPalette #share-your-stuff message

iron imp
frank kindle
#

that looks great, thanks

#

how do I add the csharp file to my project though? I couldn't really find anything about that and just adding the file to the project root makes tixl crash

iron imp
#

you probably want to throw that into your project folder with the .cs, .t3 and .t3ui file

acoustic aspen
#

this won't work

frank kindle
#

TiXL crashed. We're really sorry.

The last backup was saved seconds ago to...
C:\Users\wubwub\AppData\Roaming\TiXL\Backup

Please refer to Help > Using Backups on what to do next.

System.Exception: Could not find instance with id 3bc20573-3bad-41a5-abfa-b92c73e9cd06 and child id 11257495-7d2a-e89a-ec25-d6c27f2e986c. Symbol type: ""
at T3.Editor.UiModel.ProjectHandling.ProjectView.InstanceView.get_Instance() in C:\Users\pixtur\dev\tooll\tixl\Editor\UiModel\ProjectHandling\ProjectView.InstanceView.cs:line 98
at T3.Editor.Gui.Interaction.Timing.PlaybackUtils.FindPlaybackSettings(IResourceConsumer& owner) in C:\Users\pixtur\dev\tooll\tixl\Editor\Gui\Interaction\Timing\PlaybackUtils.cs:line 84
at T3.Editor.Gui.Interaction.Timing.PlaybackUtils.UpdatePlaybackAndSyncing() in C:\Users\pixtur\dev\tooll\tixl\Editor\Gui\Interaction\Timing\PlaybackUtils.cs:line 20
at T3.Editor.Gui.T3Ui.ProcessFrame() in C:\Users\pixtur\dev\tooll\tixl\Editor\Gui\T3UI.cs:line 79
at T3.Editor.Gui.WindowsUiContentDrawer.RenderCallback() in C:\Users\pixtur\dev\tooll\tixl\Editor\Gui\WindowsUiContentDrawer.cs:line 160
at SharpDX.Windows.RenderLoop.Run(Control form, RenderCallback renderCallback, Boolean useApplicationDoEvents)
at T3.Editor.App.AppWindow.RunRenderLoop(Action callback) in C:\Users\pixtur\dev\tooll\tixl\Editor\App\AppWindow.cs:line 115
at T3.Editor.Program.Main(String[] args) in C:\Users\pixtur\dev\tooll\tixl\Editor\Program.cs:line 201

#

I get this error

#

I suppose it is referencing something that is only present in your project

acoustic aspen
frank kindle
#

thanks

#

I did just that, but this is what appears in the console and the project doesn't how up in tixl

Warning: 1>C:\Users\wubwub\Documents\TiXL\Canvas\ColorPalette.cs(99,46): error CS1739: The best overload for 'Step' does not have a parameter named 'color' [C:\Users\wubwub\Documents\TiXL\Canvas\Canvas.csproj]
Warning: 1>C:\Users\wubwub\Documents\TiXL\NewVers\ColorPalette.cs(99,46): error CS1739: The best overload for 'Step' does not have a parameter named 'color' [C:\Users\wubwub\Documents\TiXL\NewVers\NewVers.csproj]
Warning: C:\Users\wubwub\Documents\TiXL\Canvas\ColorPalette.cs(99,46): error CS1739: The best overload for 'Step' does not have a parameter named 'color' [C:\Users\wubwub\Documents\TiXL\Canvas\Canvas.csproj]
Warning: C:\Users\wubwub\Documents\TiXL\NewVers\ColorPalette.cs(99,46): error CS1739: The best overload for 'Step' does not have a parameter named 'color' [C:\Users\wubwub\Documents\TiXL\NewVers\NewVers.csproj]
Error: Canvas: Build failed in 1470ms
Error: NewVers: Build failed in 1449ms
Error: Failed to recompile project 'Canvas:
Restore output:
Determining projects to restore...
All projects are up-to-date for restore.

#

I'm using the 4.1.0.8 version

scarlet flame
#

you have it in both NewVers and Canvas

#

should only be one copy in Canvas probably

#

but - (might) also be another issue there - if that doesnt work

acoustic aspen
#

ha yes, make sure to remove the ColorPalette.cs file you added to your project earlier

#

remove ColorPalette.cs from the NewVers folder

frank kindle
#

I still get this error:

Warning: Canvas Canvas needs to be compiled because the version info file does not exist.
Warning: 1>C:\Users\wubwub\Documents\TiXL\Canvas\ColorPalette.cs(99,46): error CS1739: The best overload for 'Step' does not have a parameter named 'color' [C:\Users\wubwub\Documents\TiXL\Canvas\Canvas.csproj]
Warning: C:\Users\wubwub\Documents\TiXL\Canvas\ColorPalette.cs(99,46): error CS1739: The best overload for 'Step' does not have a parameter named 'color' [C:\Users\wubwub\Documents\TiXL\Canvas\Canvas.csproj]
Error: Canvas: Build failed in 963ms

#

though I removed the file from all the other projects

acoustic aspen
#

I'm getting the same error :/

iron imp
#

works on my machine™

acoustic aspen
#

haha

iron imp
#

is there something I can do on my end?

#

I'm unfamiliar with "properly" doing ops

#

Oh, I see.

#

I may have accidentally created a constructor that's not in Tixl

#

@frank kindle you have to update your ColorPalette.cs file with the new version from the repo and then it will work 🙃

acoustic aspen
#

I downloaded the zip again and replaced the Canvas project with the new version.
it works

iron imp
#

thanks for checking!

frank kindle
#

I checked it too and it works for me as well, thanks 🙂

iron imp
#

You can also curate a bunch of gradients with your own file

frank kindle
#

It would be very nice if we could get something liike this merged into TiXL as a build in node

keen oyster
#

Also there is [BuildGradient] and [GenerateGradient]

shrewd condor
#

Hi. Before I discovered this thread, I was also interested in ColorPalette.cs and tried adding a file by simply placing it in my project folder. After launching TiXL, the .cs file disappeared, and now I have a Mio folder in my Symbol Library, but the operator doesn't work, and TIXL crashes.
Yes, I've now figured out how to add the file correctly, but now I can't delete the incorrect operator I added earlier. It won't delete, and I can't find a file with that name in any TIXL folders. Please help me, how can I delete this incorrect library branch?

acoustic aspen
#

If you have already deleted the ColorPalette.cs file from your project folder. You can delete the bin and obj folders before launching TiXL
This will force Tixl to recompile your project and create a new version of the bin and obj folders

#

in Tixl upcoming version, in the symbol library you'll be able to use right click and select Delete Symbol