Skip to main content
Solved

passing color rgb to pdfstyler

  • November 26, 2019
  • 8 replies
  • 55 views

tnarladni
Enthusiast
Forum|alt.badge.img+15

I am creating a legend for my pdf and using the PDFStyler to create the different line colors. Based on a certain value in an attribute, I am setting the rgb for the legend line. It looks ok in inspector after the PDFStyler, but when it goes through the PDFPageFormatter, all the lines are blue. If I were to set the color for the data individually, it is fine, it is just when I attempt to set the color from an attribute that it doesn't work. Would appreciate any help.

some of the types are not defined which is why they are black.all blue

 

Best answer by ebygomm

If you already have the colours as RGB values, you can convert. There are custom transformers on the hub that will do this conversion for you, e.g. ColorCalculator

If you want to pick colours, this site will give you fme colours

https://www.tydac.ch/color/

View original
Did this help you find an answer to your question?

8 replies

ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • November 26, 2019

I think the attributes need to be structured as FME colours not RGB if you are using the attributes to set the colour in the pdf styler, despite it displaying an RGB colour if you use the colour picker.


tnarladni
Enthusiast
Forum|alt.badge.img+15
  • Author
  • Enthusiast
  • November 26, 2019
ebygomm wrote:

I think the attributes need to be structured as FME colours not RGB if you are using the attributes to set the colour in the pdf styler, despite it displaying an RGB colour if you use the colour picker.

@ebygomm what's an fme color? how do I set that?


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • November 26, 2019
tnarladni wrote:

@ebygomm what's an fme color? how do I set that?

So the RGB colour for red is 255,0,0

FME colour for red is 1,0,0

White is 1,1,1

Black is 0,0,0

etc.


tnarladni
Enthusiast
Forum|alt.badge.img+15
  • Author
  • Enthusiast
  • November 26, 2019
ebygomm wrote:

I think the attributes need to be structured as FME colours not RGB if you are using the attributes to set the colour in the pdf styler, despite it displaying an RGB colour if you use the colour picker.

do you have a link to a help? I need more than the basic colors...like cyan and magenta. thanks!


tnarladni
Enthusiast
Forum|alt.badge.img+15
  • Author
  • Enthusiast
  • November 26, 2019
ebygomm wrote:

So the RGB colour for red is 255,0,0

FME colour for red is 1,0,0

White is 1,1,1

Black is 0,0,0

etc.

do you have a link to a help? I need more than the basic colors...like cyan and magenta. thanks!


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • Best Answer
  • November 26, 2019

If you already have the colours as RGB values, you can convert. There are custom transformers on the hub that will do this conversion for you, e.g. ColorCalculator

If you want to pick colours, this site will give you fme colours

https://www.tydac.ch/color/


ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • November 26, 2019
tnarladni wrote:

do you have a link to a help? I need more than the basic colors...like cyan and magenta. thanks!

If you already have the colours as RGB values, you can convert. There are custom transformers on the hub that will do this conversion for you, e.g. ColorCalculator

If you want to pick colours, this site will give you fme colours

https://www.tydac.ch/color/


tnarladni
Enthusiast
Forum|alt.badge.img+15
  • Author
  • Enthusiast
  • November 26, 2019
ebygomm wrote:

If you already have the colours as RGB values, you can convert. There are custom transformers on the hub that will do this conversion for you, e.g. ColorCalculator

If you want to pick colours, this site will give you fme colours

https://www.tydac.ch/color/

could you post this as an answer? so I can accept it? And thanks. that was super helpful. Also, I found that if I divide the R G B color by the full saturation 255, I get the RGB FME value


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings