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

apply fillColor to character without creating swatch?

People's Champ ,
Dec 09, 2010 Dec 09, 2010

Copy link to clipboard

Copied

Okay, I give up!!

HOW do you apply a fill color to a character (myChar) without creating a swatch?!?! You can do it in the UI by using the Color palette.

The SDK help says that fillColor can take a Swatch or a string. But I cannot find any information anywhere including the web on what that string should be.

frrrrustrating..

Thanks

Ariel

example: myChar.fillColor = [10,20,30,40] doesn't work -- well, it's not a string!, but neither does ... = "C=10 M=20 Y=30 K=40"

TOPICS
Scripting

Views

970

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

Community Expert , Dec 09, 2010 Dec 09, 2010

This has been asked before, over and over again, and it never has lead to a satisfying answer. Seems it's just Not Possible.

The string mentioned is a Swatch name (well, probably).

Votes

Translate

Translate
Community Expert ,
Dec 09, 2010 Dec 09, 2010

Copy link to clipboard

Copied

This has been asked before, over and over again, and it never has lead to a satisfying answer. Seems it's just Not Possible.

The string mentioned is a Swatch name (well, probably).

Votes

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
People's Champ ,
Dec 09, 2010 Dec 09, 2010

Copy link to clipboard

Copied

That's weird. Still good to know. Thanks Theun.

Votes

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
Advisor ,
Dec 09, 2010 Dec 09, 2010

Copy link to clipboard

Copied

OK, here is the deal.

You can change character folor fill like this:

myChar.fillColor.colorValue = [40,0,100,0];

BUT, you have to keep in mind that this will NOT work

if you want to change it from Black swatch because Black Swatch is locked.

Also, this WILL change your Swatch color.

What you porbably do is to create temporary Swatch

apply it to character, delete Swatch and then change color.

Also, you can change character fill color space like this:

myChar.fillColor.space = ColorSpace.RGB;

Hope that helps.

--

tomaxxi

http://indisnip.wordpress.com/

Votes

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 Expert ,
Dec 10, 2010 Dec 10, 2010

Copy link to clipboard

Copied

Marijan, I must admit I never tried to change color sub-parameters ...

But it seems to assume your current color space is CMYK, ¿non? How would you set the color in RGB or Lab?

Votes

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
Advisor ,
Dec 10, 2010 Dec 10, 2010

Copy link to clipboard

Copied

You can change it like this:

myChar.fillColor.space = ColorSpace.RGB;

or

myChar.fillColor.space = ColorSpace.LAB;

And then you change color.

--

tomaxxi

http://indisnip.wordpress.com/

Votes

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
People's Champ ,
Dec 10, 2010 Dec 10, 2010

Copy link to clipboard

Copied

LATEST

Thanks, as suggested I got it to work by creating a swatch. Strangely, to create a swatch you wite doc.colors.add() rahter than doc.swatches.add()

thanks again.

Ariel

Votes

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