Sony Pixel Power calrec Sony

Random Fixed Color Expression

25/06/2022

Random Fixed Color Expression

Andy Ford June 28, 2022

0 Comments

This tutorial expands upon my previous tutorial on creating a random color expression. That expression randomly changed color of your shape layer, but you achieved values that were in between the range of colors you selected. This tutorial features expressions to help you randomly change between fixed colors and not get the in-between values.

Some contents or functionalities here are not available due to your cookie preferences!

This happens because the functionality/content marked as Google Youtube uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

First, we add color controls to our shape layer for each color that we want to appear. Then, we set an expression for our shape's fill color and create variables for each and add those variables to an array. We can control the value of the array by adding a slider control, and then return the value of the array (which is determined by the slider).

Once you add Math.floor to your slider value to eliminate complexities when your slider value is not a whole number, you can control the color shown based on your slider value.

var color1 = effect( Color Control 1 )( Color );

var color2 = effect( Color Control 2 )( Color );

var color3 = effect( Color Control 3 )( Color );

var color4 = effect( Color Control 4 )( Color );

var color5 = effect( Color Control 5 )( Color );

colors=[color1,color2,color3,color4,color5];

slider=Math.floor(effect( Slider Control )( Slider ));

colors[slider];

To automate this, we need to do more. We must make a variable that makes this whole expression go. For this, we create a variable that is equal to Math.floor(time/slider). This creates a whole number value that is always changing and makes your slider value act as a throttle or speed control.

This expression needs to work in conjunction with seedRandom. The seedRandom method allows you to replay the same random movements every time. The seed value is the variable we just created above, and then we need to complete the seedRandom method with a timeless argument that is either true or false. In this case, we want to use true because that makes this timeless. By that, I mean it stays the same on each frame but still chooses a random value. If you select false, everything changes each frame, which is not what is needed in this instance.

Now we need another value that helps choose the color. Set this to Math.floor(random(colors.length)). This adds the randomness into the equation, and sets the confines of the randomness to the number of values in your array. Finally, we return the value of the colors, which in the variable just created.

var color1 = effect( Color Control 1 )( Color );

var color2 = effect( Color Control 2 )( Color );

var color3 = effect( Color Control 3 )( Color );

var color4 = effect( Color Control 4 )( Color );

var color5 = effect( Color Control 5 )( Color );

colors=[color1,color2,color3,color4,color5];

slider=effect( Slider Control )( Slider );

engine=Math.floor(time/slider);

seedRandom(engine,true);

colorChoose=Math.floor(random(colors.length));

colors[colorChoose];

Speed of color change is regulated by the slider control value.

###

Enjoying this tutorial? Sign up now for the Creative COW Newsletter!

Sign up for the Creative COW newsletter and get weekly updates on industry news, forum highlights, inspirational tutorials, tips, burning questions, and more! Receive bulletins from the largest, longest-running community dedicated to supporting professionals working in film, video, and audio.

Enter your email address, a first and last name, and let us know what you'd like to see more of in the message!

.grecaptcha-badge{visibility:hidden}.meow-contact-form .meow-contact-form__header{display:flex;margin-bottom:10px}.meow-contact-form .meow-contact-form__header .meow-contact-form__header__content{flex:1;display:flex;flex-direction:column;justify-content:center}.meow-contact-form .meow-contact-form__header .meow-contact-form__header--image--left{margin-right:10px}.meow-contact-form .meow-contact-form__header .meow-contact-form__header--image--right{margin-left:10px}.meow-contact-form--editor input{color:gray}.meow-contact-form--default{font-size:18px}.meow-contact-form--default input:not([type=submit]),.meow-contact-form--default textarea{width:100%}.meow-contact-form--default input[type=submit]{padding:10px 40px;font-size:18px;line-height:18px}.meow-contact-form--default .meow-contact-form__info{margin-top:-10px;margin-bottom:10px;font-size:14px}.meow-contact-form--default .meow-contact-form-message{font-style:italic}.meow-contact-form--default .meow-contact-form__group{margin-bottom:15px;font-size:16px}.meow-contact-form--default .meow-contact-form__group .meow-contact-form__group-input,.meow-contact-form--default .meow-contact-form__group .meow-contact-form__group-textarea{margin-top:3px;padding:5px;font-size:14px}.meow-contact-form--default .meow-contact-form__header{margin-bottom:15px}.meow-contact-form--default .meow-contact-form__header__content--title{font-size:24px;line-height:24px}.meow-contact-form--default .meow-contact-form__header__content--text{margin-top:5px;font-size:16px;line-height:16px;color:gray}.meow-contact-form--default .meow-contact-form__group-button{padding:10px 20px;border:none;margin-top:10px;cursor:pointer}.meow-contact-form--default .meow-contact-form__group-button:hover{filter:brightness(1.05)}.meow-contact-form--meowapps{padding:20px;box-shadow:0 0 5px #d8d8d8;font-size:18px;background:#fff;color:#333}.meow-contact-form--meowapps input:not([type=submit]),.meow-contact-form--meowapps textarea{width:100%;border:#e7e7e7 solid 1px}.meow-contact-form--meowapps .meow-contact-form__info{margin-top:-10px;mar
LINK: https://creativecow.net/random-fixed-color-expression/...
See more stories from creativecow

Most recent headlines

05/01/2027

Worlds first 802.15.4ab-UWB chip verified by Calterah and Rohde & Schwarz to be demoed at CES 2026

Worlds first 802.15.4ab-UWB chip verified by Calterah and Rohde & Schwarz to be ...

01/06/2026

Dolby Sets the New Standard for Premium Entertainment at CES 2026

January 6 2026, 05:30 (PST) Dolby Sets the New Standard for Premium Entertainment at CES 2026 Throughout the week, Dolby brings to life the latest innovatio...

02/05/2026

Dalet Flex LTS Delivers Smarter Search, Faster Editing, and an AI-Ready Foundation for Modern Media

Dalet, a leading technology and service provider for media-rich organizations, t...

01/05/2026

NBCUniversal's Peacock to Be First Streamer to Integrate Dolby's Full Suite of Premium Picture and Sound Innovations

January 5 2026, 18:30 (PST) NBCUniversal's Peacock to Be First Streamer to ...

01/04/2026

DOLBY AND DOUYIN EMPOWER THE NEXT GENERATON OF CREATORS WITH DOLBY VISION

January 4 2026, 18:00 (PST) DOLBY AND DOUYIN EMPOWER THE NEXT GENERATON OF CREATORS WITH DOLBY VISION Douyin Users Can Now Create And Share Videos With Stun...

31/03/2026

Spectrum TV App to Launch on Amazon Fire TV Devices

Share Copy link Facebook X Linkedin Bluesky Email...

31/03/2026

CueScript to Showcase Innovations at NAB that Add Mobilit...

CueScript, a leading international developer of professional teleprompting solutions, is enhancing its platform with three innovations that elevate flexibility,...

31/03/2026

GALSNGEAR Returns to the 2026 NAB Show with Expanded Meet...

#GALSNGEAR will host a series of meetups, panel discussions, and networking events during the 2026 NAB Show, taking place April 18 22 in Las Vegas. The organi...

31/03/2026

Imagine Introduces AI Assisted Scheduling at 2026 NAB Sho...

At the 2026 NAB Show (April 19-22, Las Vegas Convention Center, Booth #N1328), Imagine Communications is introducing AI assisted scheduling capabilities within ...

31/03/2026

PSSI boosts live sports flexibility and security with the...

High-density upgrade for mobile fleet and PSSI International Teleport gives PSSI more flexibility for premium live event coverage PSSI and Appear today announc...

31/03/2026

Solid State Logic Enhances Virtualized System T Platform to Deliver Scalable Cloud and On-Prem Production for NAB 2026

Solid State Logic Enhances Virtualized System T Platform to Deliver Scalable Clo...

31/03/2026

OWC to Showcase Storage, Workflow Acceleration, and Reliability Solutions for Creatives and Post-Production Professionals at NAB 2026

OWC to Showcase Storage, Workflow Acceleration, and Reliability Solutions for Cr...

31/03/2026

PSSI Taps Appear X for Live Coverage of FIFA World Cup

Share Copy link Facebook X Linkedin Bluesky Email...

31/03/2026

OpenDrives Shows Off Sports Expertise in Sports Business...

OpenDrives, a leader in software-defined video and rich media storage management solutions, will demonstrate several new innovations at the 2026 NAB Show in Apr...

31/03/2026

SDVI to Showcase Platform Enhancements New Technology Int...

At the 2026 NAB Show, SDVI will demonstrate how its Rally media supply chain management platform continues to give media operations teams the tools they need to...

31/03/2026

Boland Communications Introduces QD4K315HDR10 QD-OLED Ser...

Boland Communications today announced that at the 2026 NAB Show, it will introduce its new QD4K315HDR10, a 31.5-inch QD-OLED monitor delivering exceptional colo...

31/03/2026

NUGEN Audio CEO Dr Paul Tapper to Lead Presentation About...

Dr. Paul Tapper, CEO of NUGEN Audio, will lead an essential industry discussion at the 2026 NAB Show, examining whether dialog intelligibility is poised to beco...

31/03/2026

BCNEXXT at NAB 2026 - Turning Industry Pressure into Oppo...

BCNEXXT will use NAB 2026 to focus on how broadcasters can turn today's operational and market pressures into opportunity. Meeting with customers in the IAB...

31/03/2026

Mediagenix Showcases Semantic Intelligence Powered Title...

Mediagenix, a global leader in smart content solutions to profitably connect the right content to the right audience, will showcase its latest innovations at th...

31/03/2026

DHD Introduces AI-Based Audio Noise Reduction to XD3 IP C...

DHD announces that AI-based audio noise reduction is now available as a powerful new option for its XD3 IP Core. Developed in cooperation with ai-coustics, audi...

31/03/2026

PTZOptics to showcase intelligent video and camera contro...

PTZOptics will showcase its vision for intelligent video and advanced camera automation at NAB Show 2026 (#N1902). Through immersive demonstrations and technolo...

31/03/2026

Experience Commerce Wins Social Media Mandate for ICONIQA...

Experience Commerce, a leading full-service digital marketing agency and part of the Cheil SWA Group, has secured the social media mandate for ICONIQA Hotels & ...

31/03/2026

Fabric to Showcase Cloud-Native Origin Platform and Next-...

Fabric, the entertainment industry's leader in data and operations solutions, will showcase a major expansion of its media technology platform at NAB 2026, ...

31/03/2026

Boland Communications Introduces New QD-OLED Series Monitors

Share Copy link Facebook X Linkedin Bluesky Email...

31/03/2026

Carr Warns NFL Over Streaming Rights, Consumer Costs

Share Copy link Facebook X Linkedin Bluesky Email...

31/03/2026

Farhan Khan Appointed FCC Chief Information Officer

Share Copy link Facebook X Linkedin Bluesky Email...

31/03/2026

Federal Judge Pauses Nexstar/Tegna Merger

Share Copy link Facebook X Linkedin Bluesky Email...

31/03/2026

Boris FX Acquires Vegas Pro, Sound Forge, and Acid Pro

Boris FX Acquires Vegas Pro, Sound Forge, and Acid Pro Jessie Electa Petrov March 30, 2026 0 Comments The acclaimed VFX developer bolsters its award-w...

31/03/2026

Berklee India Exchange Presents Anirudh Varma Collective

Berklee India Exchange Presents Anirudh Varma Collective The collective will present a workshop on Hindustani classical music and a concert in collaboration w...

31/03/2026

Efficiency at Scale: NVIDIA, Energy Leaders Accelerating PowerFlexible AI Factories to Fortify the Grid

CERAWeek - dubbed the Davos of energy - is where policymakers, producers, techno...

30/03/2026

NAB 2026: Manifold to Demonstrate 400GbE COTS FPGA Support

Manifold Technologies, a Germany-based provider of cloud infrastructure for live broadcast production, will demonstrate support for 400GbE COTS FPGA accelerator...

30/03/2026

NAB 2026: Boland Communications Introduces QD-OLED Series Monitors

Boland Communications will introduce its QD4K315HDR10, a 31.5-inch QD-OLED monitor, at NAB Show 2026 (Booth C3519, April 18-22). The company is also introducing...

30/03/2026

NAB 2026: PTZOptics to Showcase Move 4K and Horizon Platform

PTZOptics will demonstrate its Move 4K PTZ cameras and Horizon web-based control platform at NAB Show 2026 (Booth N1902). Move 4K with Horizon is now available...

30/03/2026

NAB 2026: Net Insight to Showcase Updated Nimbra Edge

Net Insight will demonstrate the next version of Nimbra Edge, its orchestration and control layer for live media services across multi-domain environments, at N...

30/03/2026

NAB 2026: Appear to Showcase Live Production Processing

Appear ASA will exhibit at NAB Show 2026 (Booth W1531, April 19-22, Las Vegas). The company completed an IPO in November 2025. Our customer-first approach is ...

30/03/2026

NAB 2026: Harmonic Announces New Live Sports Streaming Capabilities

Harmonic has announced new capabilities for its sports streaming platform, covering multiview, programmatic advertising, in-stream advertising, and content wate...

30/03/2026

NAB 2026: Ateme to Showcase GenAI, Agentic AI, and Streaming

Ateme (Booth W1723) will demonstrate broadcast, streaming, and AI-driven media workflow solutions at NAB Show 2026. GenAI and Agentic AI Ateme will demonstrat...

30/03/2026

NAB 2026: Bitmovin's Player Web X Adds Advertising Support, Vertical Video, and Proprietary ABR Algorithm

Bitmovin has announced new capabilities for Player Web X, its web video player, ...

30/03/2026

NAB 2026: Brazil's Minister of Communications and FCC Commissioner To Speak

The 2026 NAB Show (April 18-22, exhibits April 19-22, Las Vegas Convention Center) will host Brazil's Minister of Communications, Frederico de Siqueira Filh...

30/03/2026

NAB 2026: EVS To Showcase Expanded Live Production Ecosystem

EVS will exhibit at NAB Show 2026 (Booth N1841), highlighting new products and updates across its live production portfolio, including the debut of T-Motion med...

30/03/2026

NAB 2026: Solid State Logic To Demonstrate Expanded Virtual System T Platform

Solid State Logic will demonstrate its virtualized System T platform at NAB Show 2026 (Booth C6907). Demonstrations will include the VTE1 virtual DSP engine, ne...

30/03/2026

NAB 2026: Globecast To Showcase Managed Media Services Approach

Globecast will exhibit at NAB Show 2026 (Booth W3335), highlighting its hybrid service model spanning satellite, IP, fiber, and cloud. The company will demonst...

30/03/2026

NAB 2026: IP Showcase Returns as IPMX Moves to Deployment

The Alliance for IP Media Solutions (AIMS), Advanced Media Workflow Association (AMWA), and the Video Services Forum (VSF) have announced that the IP Showcase w...

30/03/2026

NAB 2026: BBright To Demonstrate Single-Stream ST 2110 Playout

At NAB Show 2026 BBright will present a demonstration of its One Stream for the World concept, showing how a single ST 2110 playout stream can simultaneously ...

30/03/2026

NAB 2026: OpenDrives To Demonstrate New Storage and Edge Products

OpenDrives will demonstrate new products at NAB Show 2026, with two locations in the West Hall: a pod (W3443-E) in the Sports Business Hub and a cabana at W1158...

30/03/2026

Behind the Mic: Amazon Prime Hosts 90th Master Tournament With Host Terry Gannon

Behind The Mic provides a roundup of recent news regarding on-air talent, including new deals, departures, and assignments compiled from press releases and repo...

30/03/2026

Op-Ed: Preparing for Agentic AI in Live Sports

The economics of live sports streaming have changed. New rights models, cloud production tools, and lower-cost distribution have made it possible for high schoo...

30/03/2026

Movimento Strings from Sonora Cinematic

MPE-capable chamber strings library announced Alongside their collection of Kontakt instruments, Sonora Cinematic have been steadily introducing a series of...

30/03/2026

UJAM release Groovemate Latigo

Latin-inspired percussion instrument announced Built on a newly developed engine and interface, UJAM's latest instrument has been designed to create Lat...

30/03/2026

Best Service launch Desert Winds

Latest Eduardo Tarilonte collaboration announced The latest library to join Best Service's ever-growing range includes four solo wind instruments that c...