• Global community
• Language:
• Deutsch
• English
• Español
• Français
• Português
• 日本語コミュニティ
Dedicated community for Japanese speakers
• 한국 커뮤니티
Dedicated community for Korean speakers
Exit
• valeur lumière color

# valeur lumière color

Explorer ,
Nov 22, 2023 Nov 22, 2023

Copied

Bonjour,

je souhaite récupérer la valeur de la  lumière d'une couleur avec cette expression, j'ai collé cette expression sur un slider :

c=content("Rectangle 1").content("Fill 1").color;
c = rgbToHsl (c);
c[2];

Seulement la couleur qui est par exemple HSL 0° 47° 31°, l'expression indique  une valeur lumière de 0.24 au lieu de 0.31. Savez pourquoi l'expression n'indique pas 0.31 ?

merci

TOPICS
Expressions

Views

314

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
12 Replies 12
LEGEND ,
Nov 22, 2023 Nov 22, 2023

Copied

They are still normalized values in a range between 0 and 1, not angles. You need to add another conversion with a linear() expression or whatever if you really need that.

Mylenium

Report

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

Copied

Merci, vous avez la solution en expression ?

Report

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

Copied

Something like this:

linear(c[2],0,1,0,360);

Mylenium

Report

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

Copied

merci, mais maintenant j'ai une valeur de 84.70 et non pas 31 !?

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 Expert ,
Nov 22, 2023 Nov 22, 2023

Copied

Try changing your last line to:

``c[2]*240``

Report

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

Copied

Merci Dan, mais là je trouve la valeur de 56.47 et toujours pas de 31

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 Expert ,
Nov 22, 2023 Nov 22, 2023

Copied

Can you post a screen capture that show the HSL value in a color picker?

Report

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

Copied

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 Expert ,
Nov 23, 2023 Nov 23, 2023

Copied

I think the answer is that the HSB and HSL color models are different, especially for the Brightness (B) vs Lightness (L) components. There are formulas out there to convert L to B if you really need it, but I've never tried it.

Report

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

Copied

Thanks Dan, just for fun it would be interesting, right?

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 Expert ,
Nov 23, 2023 Nov 23, 2023

Copied

OK, just for fun, try this:

``````c = content("Rectangle 1").content("Fill 1").color;
hsl = rgbToHsl(c);
s = hsl[1];
l = hsl[2];
t = s*(l < .5 ? l : 1-l);
b = t + l;``````

Report

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

Copied

LATEST

trop fort MERCI BEAUCOUP !

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Resources
Troubleshooting FAQs
After Effects Community Recap
Getting started with After Effects