Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Randomize selected solid color layers always with (S > 25% & B = 50%)

Community Beginner ,
Oct 19, 2021 Oct 19, 2021

Copy link to clipboard

Copied

Hello everyone. i need help

Random Color.jpg
Thank you very much in advance

TOPICS
Actions and scripting

Views

91

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , Oct 19, 2021 Oct 19, 2021
hue need to be randomized? #target photoshop var s2t = stringIDToTypeID; (r = new ActionReference()).putProperty(s2t('property'), p = s2t('adjustment')); r.putEnumerated(s2t('layer'), s2t('ordinal'), s2t('targetEnum')); var fill = executeActionGet(r).getList(p).getObjectValue(0).getObjectValue(s2t('color')), color = new SolidColor; with (color.rgb) { red = fill.getDouble(s2t('red')) green = fill.getDouble(s2t('green')) blue = fill.getDouble(s2t('blue')) } with (color.hsb) { ...

Likes

Translate

Translate
Adobe Community Professional ,
Oct 19, 2021 Oct 19, 2021

Copy link to clipboard

Copied

hue need to be randomized?

 

#target photoshop

var s2t = stringIDToTypeID;

(r = new ActionReference()).putProperty(s2t('property'), p = s2t('adjustment'));
r.putEnumerated(s2t('layer'), s2t('ordinal'), s2t('targetEnum'));
var fill = executeActionGet(r).getList(p).getObjectValue(0).getObjectValue(s2t('color')),
    color = new SolidColor;
with (color.rgb) {
    red = fill.getDouble(s2t('red'))
    green = fill.getDouble(s2t('green'))
    blue = fill.getDouble(s2t('blue'))
}

with (color.hsb) {
    saturation = 25 + Math.random() * 75
    brightness = 50
}

(r = new ActionReference()).putEnumerated(s2t("contentLayer"), s2t("ordinal"), s2t("targetEnum"));
(d = new ActionDescriptor()).putReference(s2t("null"), r);
(d1 = new ActionDescriptor()).putDouble(s2t('red'), color.rgb.red);
d1.putDouble(s2t('grain'), color.rgb.green);
d1.putDouble(s2t('blue'), color.rgb.blue);
(d2 = new ActionDescriptor()).putObject(s2t("color"), s2t("RGBColor"), d1);
d.putObject(s2t("to"), s2t("solidColorLayer"), d2);
executeAction(s2t("set"), d, DialogModes.NO);

 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Oct 19, 2021 Oct 19, 2021

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 20, 2021 Oct 20, 2021

Copy link to clipboard

Copied

LATEST
Dear, @Kukurykus:
Yes i think it's the same idea

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 20, 2021 Oct 20, 2021

Copy link to clipboard

Copied

Thanks a lot!!!! thats it!!! You helped me so much!!!
Headache problems that can't be solved without you

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines