Bug: Printing using a dark theme reverse colors on print

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.

  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;

Bug: Printing using a dark theme reverse colors on print

Postby pmk65 » Sun Oct 11, 2015 9:37 am

Changing the colors of the editor area using a dark Theme like "Base 16: Twilight Colour Scheme" or "Base 16: Ocean Colour Scheme" affects printing of documents.

Instead of printing BLACK text on WHITE background, ALL text is printed in WHITE on BLACK background!

See screenshot: http://i.imgur.com/1elbMut.png
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

Re: Bug: Printing using a dark theme reverse colors on print

Postby Aivars » Tue Oct 13, 2015 6:46 pm

I see, I'll add this to bugs list.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2452
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Bug: Printing using a dark theme reverse colors on print

Postby pmk65 » Fri Feb 03, 2017 6:36 pm

*Bump*

The problem still exists in current version of WeBuilder. :(
Just try making a "Print Preview"
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

Re: Bug: Printing using a dark theme reverse colors on print

Postby Aivars » Fri Feb 03, 2017 7:24 pm

The problem is... how to work around this? If we just set background to white then white and very light text colors wouldn't be visible. Just enforcing every text to be black would annoy customers who use dark-on-white color schemes and are used to their printouts matching the syntax highlighter.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2452
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Bug: Printing using a dark theme reverse colors on print

Postby pmk65 » Sat Feb 04, 2017 1:52 am

As it is now, it will only show a nice output IF the background color IS true WHITE (#FFFFFF)
Any other background color will be printed, making the output look ugly and hard to read.

So you could check if the current background color is set to #FFFFFF.
If TRUE, then print as in color (As it does now)
If FALSE, then print in B/W.

That would at make the output usable. (And I usually just want the code printed in B/W anyway.)
Currently there's no way to print it in true B/W either, only in greyscale tones.

The best option would be have 2 "Print" methods:
1) True B/W (background white and text black)
2) Color (where background color ALWAYS is set to white before printing. Then if the user want's color output, he/she will have to select a Color Scheme that is printable.)

Currently I have to open the documents I want to print in a 2nd program, or switch to a Color Scheme with white background. (Both options are equally annoying)
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

Re: Bug: Printing using a dark theme reverse colors on print

Postby Will Fastie » Thu Dec 27, 2018 5:47 am

I do not print much, so I just bumped into this problem. Even though I do not print much, it is essential that printing be available when needed.

I propose having two profiles, one for the screen and one for the printer.

As a stopgap measure, I propose using a white background for all printing even if the colors are somewhat faint. This is preferable to the current situation, which has two problems:
  • The black background is only printed under text, not across the entire page. I find this extremely hard to read.
  • The black background consumes a lot of ink/toner.
I tried turning off Print Highlighted in Options but that resulted in black and white printing only, with the line numbers printed light gray on black. I'm looking for color printing.

I note that this thread has been around for quite some time, suggesting the Blumentals does not give it much priority. I think this needs to be fixed.

Note: Visual Studio Code has no print capability at all. However, there is a VSC extension called PrintCode that prints by converting the code into HTML and launcing a browser to print it. That would be another acceptable compromise until this can be fixed properly in RAPID.
Will
WebDesignBuild.biz, Fastie.com
User avatar
Will Fastie
 
Posts: 160
Joined: Mon Jan 31, 2005 6:47 pm
Location: Timonium, MD USA

Re: Bug: Printing using a dark theme reverse colors on print

Postby pmk65 » Thu Dec 27, 2018 3:14 pm

Will Fastie wrote:Note: Visual Studio Code has no print capability at all. However, there is a VSC extension called PrintCode that prints by converting the code into HTML and launcing a browser to print it. That would be another acceptable compromise until this can be fixed properly in RAPID.


That's pretty much the same I ended up doing in my BW Print plugin. But unfortunately ALL browsers suck when it comes to printing.
There's a lot of HTML/CSS printing features, but browsers doesn't currently support the same features. Here's a Gist example of a CSS printing stylesheet I made a while ago. If you use that for printing in browsers, you will notice that some of the CSS is ignored by some browsers, but work in others.
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

Re: Bug: Printing using a dark theme reverse colors on print

Postby Aivars » Tue Jan 08, 2019 6:47 pm

The best thing to do if you're using dark background is to go to menu Options -> Preferences -> Other and check Black & White. That eliminates all colors but it does leave bold texts bold and it will always print on white background thus saving the toner.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2452
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Bug: Printing using a dark theme reverse colors on print

Postby Hans Meiser » Sun Jan 13, 2019 1:15 pm

Just a general question on this topic:
When opening a XSC file, the colors are represented as integers. How are those integers calculated, because I can't see how it's done. I only know that its from 0 upwards.
The reason I want to know is, I would like to make a simple solution to generate themes, because right now it's a pain in the ass to jump and copy&paste between all those options in the settings menu. So, any hint on that would be appreciated.

Edit:
Never mind, just found out, that with PHPs hexdec and a reversed RGB value I can get those integer values. :)
Hans Meiser
 
Posts: 67
Joined: Tue Aug 12, 2014 5:01 pm

Re: Bug: Printing using a dark theme reverse colors on print

Postby pmk65 » Sun Jan 13, 2019 1:41 pm

Colors are in BGR decimal format. (I wrote a PHP script to convert all the Base16 color schemes to WeBuilder format a while ago)

So a decimal number like 4538169 would translate to #453F39 hexadecimal.

B = 45
G = 3F
R = 39

To get the RGB value, you swap the values, like this:

39 3F 45 = #393F45

Here's the PHP conversion function I made (Bidirectional, so it can convert rgb2bgr and bgr2rgb in either hex or dec):
Code: Select all
   function rgb2bgr($val, $hex = 1) {
      $val = is_string($val) ? hexdec($val) : $val;
      $val = (($val & 0x0000FF) << 16 | ($val & 0x00FF00) | ($val & 0xFF0000) >> 16);
      return $hex ? sprintf('#%x', $val) : $val;
   }
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark


Return to HTMLPad / Rapid CSS / Rapid PHP / WeBuilder Support

Who is online

Users browsing this forum: No registered users and 1 guest