Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some minor things that have been piling up #37

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

DGruenwald
Copy link
Contributor

@DGruenwald DGruenwald commented Apr 23, 2017

Changes:

  • Rearranged some of the code into a more logical order.
  • Added a .pow() operation using Math.pow(x, y). Useful for increasing or decreasing contrast.
  • Added a globalSeed variable that gets incremented on each use to avoid 'seed collisions' in cases where there's less than 1ms between calls.
  • Added a size-parameter to TG.Noise that increases the 'grid' of the noise (makes it more 'pixel-y').
  • Added the posibility to 'initialize' a filter. Simply, code that gets run shortly before the main loop.
  • Simplified TG.Posterize, since I over-engineered it a bit.
  • Added the cosine interpolation method.
  • Allowing to input rgb-values individually to .point()-functions for gradients on top of arrays.
  • Copy some arguments for convenience, e.g. .tint(0.5) sets r, g and b.
  • Removed extra indentation inside TG.Transform.
  • Rename TG.Number to TG.Fill like discussed (Renaming TG.Number to TG.Constant #30).
  • Reversed some 'offset'-parameters to make them more intuitive, so that a positive offset moves the texture to the right for example.
  • Made TG.SinX and TG.SinY frequency relative to pixels, meaning setting frequency to, for example, 20 means the sine wave will be 20 pixels wide.
  • Added a comment to every generator and parameter explaining what they do (maybe resolves Add some background on how to use this #33?).
  • Some changes to the examples page including adding CodeMirror syntax-highlighting

The renaming of TG.Number, reversing offsets and making frequency relative to pixels breaks older stuff of course, but I made sure that the examples still work.

If something doesn't seem right, feel free to tell me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add some background on how to use this
1 participant