ScriptSpot home

Script

Color Mixer

By Vojtech Cada · 2011-07-14

Community compatibilityNo compatibility reports yet

No reports yet for the available releases.

Community reviewsNo reviews yet.
Version
0.1
3ds Max compatibility
Unknown
How compatibility works

Choose the 3ds Max version you use. For example, selecting 2020 puts direct matches for 2020 first, followed by listings that say a supported version or newer.

Scripts that only mention an older version can still appear as “2020 unconfirmed.” Listings that rule out 2020 are excluded. Use “Show scripts with unconfirmed compatibility” to also see listings without a clear match.

Community reports show what worked for members on a specific release. They’re separate from the listing’s compatibility claims and don’t change the filter.

Original version requirement
3ds Max 9, VIZ 2008
Other software required
for Max 9/VIZ 2008 AVGuard extension is needed
Date updated
2013-12-21
Legacy votes
6

Release history

  • Version 0.1Listed version

    Listing updated

    No download linked to this version

    Release notes

    Version 0.1:

Earlier releases (5)
  • Version 0.06

    No download linked to this version

    Release notes

    Version 0.06:

  • Version 0.05

    No download linked to this version

    Release notes

    Version 0.05:

  • Version 0.04

    No download linked to this version

    Release notes

    Version 0.04:

  • Version 0.03

    No download linked to this version

    Release notes

    Version 0.03:

  • Version 0.02

    No download linked to this version

    Release notes

    Version 0.02:

Downloads

Tags: Color, RGB, Gradient, mix, mixer, blend, hsv

Description

Simple color mixer. You can change the number of segments of the gradient control and move the slider or enter a percentage to get a desired blend of two colors in RGB or HSV color space. The width of the dialog can be changed.

Color Mixer UI

I made this script because quite frequently in the past I had to reach for Photoshop or Mix color map just to find a value somewhere in-between two colors. This control offers more intuitive way of blending them and more control over the result. The two source colors and the resulting blend color are colorpickers and as such you can right-click them and copy/paste their values.

For newer max versions (starting with max 2020) you can use the colorMixerQt.ms file instead:

Installation: The .ms file can be run from any location (Maxscript -> Run Script...). If you want to put it in toolbar, menu or quadmenu, you can create a macroscript using Macroscript Creator.

Additional Info

Changelog:

Version 0.1:
Qt version for newer max.

Version 0.06:
Works in newer max version now.

Version 0.05:
Right-clicking the bar gives option to copy color code to clipboard (RGB, HEX, HSB, OLE, approx. CMYK).
Code cleanup and refactoring.

Version 0.04:
Fixed a few bugs, including double gamma.
Thanks to MrTom and obaida for pointing out the issues.

Version 0.03:
Colors are now gamma corrected.

Version 0.02:
Added HSV/RGB color space switcher.

More by Vojtech Cada

View all contributions
Comments (16)

Comment policy

.eb

Well, the time has come.. Max 2024 deprecated IDisplayGamma and removed its' properties.
Max 2024 has a Color Converter Utility.

Reply to .eb
Vojtech Cada

For max 2024 you can use the colorMixerQt.ms file which shouldn't have this issue.

MrTom

Excellent!

Thanks for updating this, appreciated.

I wonder though if this code seems a little redundant maybe?


on cpResult changed val do
    cpResult.color = getColorAtPos (int(dncTriBtn1.pos.x - 105))

It kind of says, "when I'm changed, change me again"

I've put that line into the next event handler down so that changing the % spinner value changes the output colour....


on spnPercent changed val do
(
	local ctrl = btn_controls[(0.01 * btn_controls.count) * (100 - val) + 1]
	dncTriBtn1.pos.x = dncTriBtn2.pos.x = 106 + ctrl.Location.X + ctrl.Width/2
	cpResult.color = getColorAtPos (int(dncTriBtn1.pos.x - 105))		
)

Best regards.
MrTom.

Reply to MrTom
Vojtech Cada

Cool, thanks for spotting that :) I've included that bit in the refactored version, if you spot any other problem/oversight, don't hesistate to let me know, I really value that.

IIRC it was there to prevent one from accidentally changing the result color but it was a stupid decision eitherway :)

MrTom

Fixed, I think....?

Further to my last post I think I have found the error....

Changed:


fn getStepColor clr clr_step mode =
	case mode of
	(
		#rgb : gammaCorrect (clr + clr_step) gamma
		#hsv : gammaCorrect (hsvToClr [clr.h + ............
	)

To:


fn getStepColor clr clr_step mode = 
	case mode of
	(
		#rgb : gammaCorrect (clr + clr_step) gamma
		#hsv : gammaCorrect (convertHsv2rgb [clr.h +  ............
	)

Is this correct? It seems to work ok.

I did find a couple more [ minor ] issues though in the process, see image for details.

Regards.

Attachments
MrTom

Error.

Ran the .ms script from editor...all fine until I click the HSV button.
The image shows the error produced.

I acknowledged the error and closed the rollout.
Ran the script again and the same error occurred instantly.

Closed Max and re-opened, ran script again....instant error again.

Using:
Win 7u SP1 x64
Max 2013 pu6 x64

Regards.

Attachments
obaida

another issue here ! the (result color) has bouble gamma !?

Attachments
obaida

Important script

Thank you for this script , I noticed that the color in slider bar have gamma 1.0 even if the gamma set to 2.2 !!?
so , any fix for this issue .

Reply to obaida
Vojtech Cada

Updated

Thanks for using it, I've updated the script to handle gamma correction.

Script_Butler

I think it's overwritten another of your scripts.

Hi,

I've just installed this script by dragging the .mcr file in to max. When i go to customize user interface, the only thing listed in the advanced drop down is Render Info Strip, when i drag this on to a toolbar and run it, it open the color mixer!

Could you check this scripts .mcr to see if this is true or not.

Cheers.

JokerMartini

Nice!

Great work SwordSalyer,
This is unique but very creative script. Great Idea.

Thanks for sharing the code as well
JokerMartini