Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > General Discussion
  New Posts New Posts RSS Feed - Navy Blue color is wrong
  FAQ FAQ  Forum Search   Register Register  Login Login

Navy Blue color is wrong

 Post Reply Post Reply
Author
Message
fletchsod View Drop Down
Team Player
Team Player


Joined: 11 Sep 20
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote fletchsod Quote  Post ReplyReply Direct Link To This Post Topic: Navy Blue color is wrong
    Posted: 15 Jun 21 at 3:53PM
When I used this to try making the font color be Navy Blue but it end up as a bright blue.  Why?


        private readonly Color _argbColorIsNavyBlue = Color.FromArgb(35, 35, 142);

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3527
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 15 Jun 21 at 7:49PM
Is this syntax from QuickPDF... i think no? ;-)
The data should make navy blue - dealing with online rgb generators make it.
Think there are still some settings before having influence on the color?

Cheers,
Ingo

Back to Top
fletchsod View Drop Down
Team Player
Team Player


Joined: 11 Sep 20
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote fletchsod Quote  Post ReplyReply Direct Link To This Post Posted: 16 Jun 21 at 2:53PM
var argColorIsNavyBlue = Color.FromArgb(35, 35, 142);   // .NET Color

pdfApp.SetTextColor(argColorIsNavyBlue.R, argColorIsNavyBlue.G, argColorIsNavyBlue.B);  // Passed on RGB value to Quick PDF's SetTextColor
Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 437
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 16 Jun 21 at 4:29PM
QP.SetTextColor arguments should be Double values between 0 and 1.0.  I suspect that Color.R and friends are bytes, but I am not that familiar with C#.
Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 437
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 16 Jun 21 at 4:34PM
QP.SetTextColor(35.0/255.0, 35.0/255.0, 142.0/255.0);  // looks like Navy Blue to me!

Back to Top
fletchsod View Drop Down
Team Player
Team Player


Joined: 11 Sep 20
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote fletchsod Quote  Post ReplyReply Direct Link To This Post Posted: 16 Jun 21 at 8:03PM
Okay, another question.  How come the color Red works but not different Green color?


QP.SetTextColor(255.0/255.0, 0.0/255.0, 0.0/255.0);    // Red

QP.SetTextColor(0.0/255.0, 128.0/255.0, 0.0/255.0);    // Green


Edited by fletchsod - 18 Jun 21 at 5:14PM
Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 437
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 18 Jun 21 at 5:10PM
Please clarify what you mean by 'different'. For light green you need to start with white and reduce the red and blue. What you show should be darker green. For selecting colours I always go to an application like Paint.net with a good colour-picker that I can adjust, and which then displays the RGB and HSV values. Does this not paint correctly in QPDF when you divide the values by 255?
Back to Top
fletchsod View Drop Down
Team Player
Team Player


Joined: 11 Sep 20
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote fletchsod Quote  Post ReplyReply Direct Link To This Post Posted: 18 Jun 21 at 5:14PM
Post the sample code here that works for you when you tested it.

Ignore the comment regarding different green.  That remark comment is wrong but my post comment is correct.   I updated the post to remove the word "Different". 

Thanks.


Edited by fletchsod - 18 Jun 21 at 5:16PM
Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 437
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 18 Jun 21 at 6:44PM
Sorry, I am not a C# user and I cannot test your code. We are all users here.

I just went to the Foxit PDF Library Dashboard, found the Text and HTML / Draw Text sample script, then added one line near the top reading QP.SetTextColor(0.0, 0.5, 0.0);

When I ran the modified sample script, it came out green, a bit darker than with 1.0 as the second parameter.  These sample scripts are an excellent way to test QP functions quickly. If things work in the scripting, you then just have to change the syntax details to your own programming language.
Back to Top
fletchsod View Drop Down
Team Player
Team Player


Joined: 11 Sep 20
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote fletchsod Quote  Post ReplyReply Direct Link To This Post Posted: 18 Jun 21 at 7:02PM
I don't mean C# example.  Just the Quick PDF example.   Ok, seeing your example, I know what the issue is now.  It works now when the 0.0 was used instead of 0 in my case.  I think the C++ Quick PDF component internally see things a bit different.

Thanks.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store