PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 27, 2024 5:53 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Feb 10, 2010 3:55 pm 
Offline

Joined: Wed Feb 10, 2010 3:49 pm
Posts: 10
Hi all,

I'm hoping one of you may be able to help me out! I'm using MigraDoc and so far it's been excellent. Any little problems I have come up again, reading through this forum has helped me solve it. Unfortunately so far I haven't found any help on my new problem!

I need to set some background/font colors etc, but the colours need to be exact and the built in ones don't come close enough. So I've got either the hex value (#B8B9BB) or the RGB values (184,185,187) but I can't seem to find a way to use these in MigraDoc. I noticed the function MigraDoc.DocumentObjectModel.Color.FromCmyk allows you to input the values for each colour, but there is not equivalent FromRGB function. I also tried using MigraDoc.DocumentObjectModel.Color.Parse("B8B9BB") but that didn't work :(

Any help you can give me would be massively appreciated!

Thanks in advance.


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 10, 2010 4:39 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
Hi!

Try these constructors:
ARGB: Color(UInt32) Initializes a new instance of the Color class.
RGB: Color(Byte, Byte, Byte) Initializes a new instance of the Color class.
ARGB: Color(Byte, Byte, Byte, Byte) Initializes a new instance of the Color class.

Parse expects decimals. Use prefix "0x" for hex.
This should work (untested):
MigraDoc.DocumentObjectModel.Color.Parse("0xB8B9BB")

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 10, 2010 4:48 pm 
Offline

Joined: Wed Feb 10, 2010 3:49 pm
Posts: 10
Wow, can't believe I missed that! It's been a long day :)

It's worked perfectly. Thanks very much for your quick response!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 425 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group