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...

08/02/2026

SMT Brings New AR Weather Visualization and a Refreshed Telestration Look to NBC Sports' Super Bowl Game Coverage

A look inside the tech, tools, and the team that make the Super Bowl into true e...

08/02/2026

Telemundo Deportes Expands Comprehensive Super Bowl LX Coverage to Its Biggest in History

Studio programming is leveraging multiple sets at Levi's Stadium in Santa Cl...

08/02/2026

Van Wagner Strengthens Levi's Stadium's Revamped Control Room To Match Production Needs of Super Bowl LX

The annual production is a partnership between the NFL and the host venue NFL f...

08/02/2026

NEP's TFC Infrastructure and SS71 IBC-Style' Core Power a Progressive Super Bowl LX Infrastructure for NBC Sports

A software-defined IP backbone and centralized signal control hub redefine champ...

08/02/2026

NBC Sports' Super Bowl Compound Signals How IP Has Become the Foundation for Mega-Event Production

NEP's TFC Fabric empowers NBC to treat a 22-Unit production as one seamless ...

08/02/2026

NBC Sports Builds Its Super Bowl LX Game Broadcast Upon the Shoulders of a Proven Sunday Night Football' Engine - and Pushes It Further

Game coverage will feature nearly 100 cameras, a deep well of replay channels, a...

08/02/2026

The Alum Behind the Sound of the Super Bowl

The Alum Behind the Sound of the Super Bowl Joshua Sutherland BM '19 was recently interviewed by the Boston Globe about his role as music supervisor for t...

08/02/2026

VEON and JazzWorld Launch Invest in Pakistan, NOW! Inviting International Investors to Participate in Pakistan's Growth

08 Feb 2026 VEON and JazzWorld Launch Invest in Pakistan, NOW! Inviting Inter...

07/02/2026

X Games to Host First-Ever Summer Athlete Draft at Cosm Los Angeles on March 12

X Games will host a live event taking place Thursday, March 12 at Cosm Los Angeles, marking the first-ever draft in X Games history and the official launch poin...

07/02/2026

Canon Supports Creative Needs for NBC Sports, Photographers at Super Bowl LX

Onsite experts and shop inside the stadium are providing quick solutions Before any live event production, there is a high probability that unpredictable issue...

07/02/2026

NBC Sports Goes Cinematic on Super Bowl LX Pregame Show With Canon's New 11-55mm Cine Servo Lens

Three Sony HDC-F5500s will capture this look on the broadcaster's concourse ...

07/02/2026

Ross Video Brings In-Venue Experience of Super Bowl LX to Life With Additional Tech, Knowledgeable Onsite Team

Inclusion in control-room revamp proves pivotal to supporting this tentpole even...

07/02/2026

Bleacher Report Builds a Three-Activation, Remote-First Super Bowl Content Factory on Radio Row

The digital giant also produced episodes of The Edge with Micah Parsons' be...

07/02/2026

Gray Media Inks Expanded Telemundo Affiliation Agreement

Share Copy link Facebook X Linkedin Bluesky Email...

07/02/2026

AIMS Announces Certification of First 48 IPMX Products

Share Copy link Facebook X Linkedin Bluesky Email...

07/02/2026

Levi Stadium Gets Major Wireless Upgrade for Super Bowl LX

Share Copy link Facebook X Linkedin Bluesky Email...

06/02/2026

Appear Appoints Simon Frost as CMO to Accelerate Global Expansion and Customer Engagement

Appear, which specializes in live production technology, announces the appointme...

06/02/2026

CBS Sports to Air Inaugural Baller League USA Season

Baller League US announces CBS Sports and its 24/7 soccer streaming channel CBS Sports Golazo Network will air the league's programming in the United States...

06/02/2026

Gravity Media Powers Australian Open 2026 with Broadcast and Production Infrastructure

Gravity Media, which concentrates in production, content, media services, and fa...

06/02/2026

AIMS Announces Certification of First 48 IPMX Products

The Alliance for IP Media Solutions (AIMS), together with the Video Services Forum (VSF), the Advanced Media Workflow Association (AMWA), and the European Broad...

06/02/2026

1001 Selects Bitmovin Player to Elevate its Video Streaming Capabilities

Bitmovin, a provider of video streaming solutions, announces that 1001, an OTT service in Iraq, has chosen the Bitmovin Player to improve its video streaming pe...

06/02/2026

Combate Global Licenses Live English TV Rights To YouTube Creator Shane Fazen

Combate Global and content creator Shane Fazen announce a licensing agreement to distribute the Hispanic-focused franchise's first three live MMA events in ...

06/02/2026

Behind the Cisco Technology Connecting Super Bowl Fans

Cisco is powering the invisible backbone of Super Bowl LX at Levi's Stadium as the technology giant delivers secure, high-capacity connectivity for over 70,...

06/02/2026

A Decade of NFL Next Gen Stats Innovation

Over the past decade, the NFL and Amazon Web Services have changed how football analytics are analyzed and presented through Next Gen Stats. There's real-ti...

06/02/2026

SVG GameDay: Seattle Seahawks' Kenton Olson - Two Decades in the Pacific Northwest

In-venue and creative video staffers at the professional and collegiate level ha...

06/02/2026

SVG GameDay: New England Patriots' Ashok Moore - Capturing the Passion of the Fanbase

In-venue and creative video staffers at the professional and collegiate level ha...

06/02/2026

Ratings Roundup: FOX Sports Delivers Most Watched Westminster Dog Show Since '21; FS1 Earns Most-Watched CBB Game Ever

Ratings Roundup is a rundown of recent rating news and is derived from press rel...

06/02/2026

NESN Goes Fast and Light' on Radio Row for Multiplatform Coverage of Patriots' Super Bowl Return

How the podcast-turned-studio-show Boston Has Entered The Chat became an anchor ...

06/02/2026

Inside Austrian Broadcaster ORF's Winter Games Production

ORF, the public service broadcaster for Austria, is in Italy for Milano Cortina 2026, ready to bring the country's most popular winter sports direct to view...

06/02/2026

ORF Chief Director Michael Kgler on Taking the Lead Position for the OBS Alpine Men's Downhill World Feed

Milano Cortina 2026 is now underway and Austrian public service broadcaster, ORF...

06/02/2026

Warner Bros. Discovery Unveils its Winter Olympic Studios in the Heart of Cortina and Livigno

Warner Bros. Discovery (WBD) has lifted the curtain on its studios in Italy that...

06/02/2026

The Winter Olympics are Finally Back at NRK and the Norwegian Broadcaster is Ready to Shred the Gnar

Milano Cortina marks the first time since London 2012 that NRK has had the full ...

06/02/2026

Managing Crews and Connectivity From Italy to Oslo for NRK's Onsite Productions from the Winter Olympics

Winter sports are wildly popular in Norway, with cross-country skiing and biathl...

06/02/2026

NRK's View From its Oslo HQ of the Action on the Slopes as it Brings XR and 1080p to the Games for the First Time

Norwegian broadcaster NRK has the free-to-air rights to the Olympics back for th...

06/02/2026

EA SPORTS Scales Madden Bowl Into Multi-Site, Multi-Stream Production for Super Bowl LX Week

The production of the mega-esports event also leverages facilities at EA headqua...

06/02/2026

Stay Tuned to SVG All Weekend for Behind-the-Scenes Reports From Super Bowl LX

Here's a preview of NBC's massive game and pregame production operation as Super Bowl Sunday approaches....

06/02/2026

Introducing About the Song, a New Way to Explore the Stories Behind the Music

Music fans know the feeling: A song stops you in your tracks, and you immediately want to know more. What inspired it, and what's the meaning behind it? We ...

06/02/2026

CALL FOR NOMINATION OF INDIVIDUALS TO SERVE AS ADVISORY PANEL MEMBERS FOR PRODUCTION & DEVELOPMENT

The National Film and Video Foundation (NFVF), an agency of the Department of Sp...

06/02/2026

Calrec Wins Best of Show at ISE 2026

Calrec Wins Best of Show at ISE 2026 for Orchestrating Distributed IP Production Calrec is delighted to announce that its IP Ecosystem Powered by True Control...

06/02/2026

Latest Nielsen data shows Winter Olympics poised to attract younger, higher-income audiences

Despite most never having strapped on skis or skates, Aussies are keen for some ...

06/02/2026

MNC Software Launches Tapestry Orchestration Platform at...

MNC Software, a global leader in network management and operational support systems tailored to the broadcast and media industry, today announced the launch of ...

06/02/2026

Hippotizer MX Series Drives 52TB of Video for Junior Euro...

The annual Junior Eurovision Song Contest arrived at Tbilisi's Gymnastic Hall in Olympic City, presenting an international stage for young talent with rich,...

06/02/2026

Sonnet Technologies at the 2026 NAB Show

NAB Show 2026 | April 19 22 | Booth # N2471 At this year s NAB Show, Sonnet will showcase new Thunderbolt 5 products, including desktop and rackmount PCIe card...

06/02/2026

AIMS Announces Certification of First 48 IPMX Products

The Alliance for IP Media Solutions (AIMS), together with the Video Services Forum (VSF), the Advanced Media Workflow Association (AMWA), and the European Broad...