# Tint Speed Adjustment

**URL:** <https://discourse.processing.org/t/tint-speed-adjustment/24446>\
**Category:** Coding Questions\
**Created:** [October 8, 2020, 5:46pm UTC](https://discourse.processing.org/t/tint-speed-adjustment/24446 "2020-10-08T17:46:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![stellakramer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/stellakramer/32/10797_2.png) [@stellakramer](https://discourse.processing.org/u/stellakramer)\
**Post date:** [October 8, 2020, 5:46pm UTC](https://discourse.processing.org/t/tint-speed-adjustment/24446/1 "2020-10-08T17:46:13Z")

</div>

Helloooo I’m back with another question😊.

This time it’s about the tint function.  
I like being able to set the tint to random but it moves very fast, is there any way to slow down the tint speed? I think I heard somewhere that the speed Processing uses is 60fps, Could that be slowed down? Or is that going to slow the whole code down? Is it possible to just slow down the tint speed and how could I do that?

I hope someone had an answer for me.

---

<div class="post-metadata">

**Author:** ![tony](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tony/32/949_2.png) [@tony](https://discourse.processing.org/u/tony)\
**Post date:** [October 8, 2020, 6:14pm UTC](https://discourse.processing.org/t/tint-speed-adjustment/24446/2 "2020-10-08T18:14:37Z")

</div>

Can you post some code?

---

<div class="post-metadata">

**Author:** ![stellakramer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/stellakramer/32/10797_2.png) [@stellakramer](https://discourse.processing.org/u/stellakramer)\
**Post date:** [October 8, 2020, 8:08pm UTC](https://discourse.processing.org/t/tint-speed-adjustment/24446/3 "2020-10-08T20:08:14Z")

</div>

// Make sure RGB is within range  
rtotal = constrain(rtotal, random (200),255);  
gtotal = constrain(gtotal, random (200),255);  
btotal = constrain(btotal, random (225),255);

It’s part of the convolution example on the [processing.org](http://processing.org) site. I set the tint of the square to random and it does what I want to do, but the colours are moving very fast and I would like it to be slower.  
And maybe you have an idea on how to change the size and shape of the square?

Thank you! 😊

---

<div class="post-metadata">

**Author:** ![tony](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tony/32/949_2.png) [@tony](https://discourse.processing.org/u/tony)\
**Post date:** [October 9, 2020, 4:12am UTC](https://discourse.processing.org/t/tint-speed-adjustment/24446/4 "2020-10-09T04:12:27Z")

</div>

> [@stellakramer](#):
>
> Could that be slowed down?

Hm, I don’t think I understand your code question. But for this specific question you’re in luck; you can set the max frame rate of a sketch with the `frameRate(24)` method. In addition, if you call it without any parameters, it serves as a getter.

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [October 9, 2020, 10:38am UTC](https://discourse.processing.org/t/tint-speed-adjustment/24446/5 "2020-10-09T10:38:40Z")

</div>

> [@stellakramer](#):
>
> I think I heard somewhere that the speed Processing uses is 60fps, Could that be slowed down?

_[frameRate() / Reference / Processing.org](https://processing.org/reference/frameRate_.html)_

> [@stellakramer](#):
>
> Or is that going to slow the whole code down?

_[draw() / Reference / Processing.org](https://processing.org/reference/draw_.html)_

> [@stellakramer](#):
>
> And maybe you have an idea on how to change the size and shape of the square?

Loot a the code in the example and start to investigate and tinker with each variable:

```auto
  // Calculate the small rectangle we will process
  int xstart = constrain(mouseX - w/2, 0, img.width);
  int ystart = constrain(mouseY - w/2, 0, img.height);
  int xend = constrain(mouseX + w/2, 0, img.width);
  int yend = constrain(mouseY + w/2, 0, img.height);

```

> [@stellakramer](#):
>
> I hope someone had an answer for me.

One of the best tools in a programmer’s tool chest is knowing the resources available to you and learning to navigate, filter, and use them.

A short list of resources to peruse:

> **Resources \< Click here to expand !**
>
> Explore the resources available here:
> 
> - The Processing _website_ has references, examples, tutorials, links to resources, etc.  
> [https://processing.org/](https://processing.org/)
> 
> - The Processing PDE (IDE) has lots to offer!  
> An exploration of the menu bar will reveal what is available there;  
> libraries, tools, local examples, and other goodies are in there.
> 
> - The Coding Train \< Experience the unbridled enthusiasm of Daniel Shiffman  
> [https://shiffman.net/](https://shiffman.net/)  
> [https://www.youtube.com/user/shiffman](https://www.youtube.com/user/shiffman)  
> [https://thecodingtrain.com/](https://thecodingtrain.com/)
> 
> - Happy Coding  
> [Processing Tutorials - Happy Coding](https://happycoding.io/tutorials/processing/)
> 
> - The source code can give insight if you are adventurous:  
> [GitHub - processing/processing: Source code for the Processing Core and Development Environment (PDE)](https://github.com/processing/processing)
> 
> - Explore Processing on GitHub:  
> [Processing Foundation · GitHub](https://github.com/processing)  
> [processing/core/src/processing/core/PApplet.java at master · processing/processing · GitHub](https://github.com/processing/processing/blob/master/core/src/processing/core/PApplet.java) \< Many of the Processing functions are here!
> 
> - The Processing Foundation  
> [https://processingfoundation.org/](https://processingfoundation.org/)  
> Check out the menu.  
> In the education menu, there is a reference to the Coding Train.
> 
> - And the Internet. `:)`

`:)`
