Pasted Copied Code from a Dark Theme Hard to Read

Is there anyway possible to do a special paste after copying some code in Webstorm that's based on a dark theme in terms of being able to read that code elsewhere like an email, or if pasted into OneNote?  Does OS X or some other app in the app store provide some kind of transformation to do so?

I love using dark themes but it's pissing me off every time I have to figure out a way to make the code readable outside.

For example I copied some code from the Obsidian Theme to OneNote and here's how it looked:

Screen Shot 2015-05-26 at 2.21.59 PM.png

Screen Shot 2015-05-26 at 2.22.58 PM.png

I realize I could just go to a text editor and paste it in there and it'll turn all black but I do like the color coding if I can retain that somehow.  I know that in some IDEs it also copies the background.  I would like the option of somehow doing that or remove the background and transform the text to different color scheme to make more readable.  I'm probably asking for the impossible but figured to post and see if anyone has gotten around this pain.

1 comment
Comment actions Permalink

Hi there,

This is what I get when copy-paste using Darcula color scheme (PhpStorm v9) -- it's actual text and not image:

<?php
$array = [
    0 => 'zero',
    1 => 'one',
    2 => 'two'
];

foreach ($array as $key => $name) {
    // $key unused here
    echo "Value of array: {$key}";
}

$conn = mysqli_connect();
$sql = "SELECT * FROM test";
$res = mysqli_query($conn, $sql);



The same from PhpStorm v8.0.3

<?php
$array = [
    0 => 'zero',
    1
=> 'one',
    2
=> 'two'
];

foreach
($array as $key => $name) {
    // $key unused here
    echo "Value of array:
{$key}";
}

$conn = mysqli_connect();
$sql
= "SELECT * FROM test";
$res
= mysqli_query($conn, $sql);


As you can see at least here all colors where copied correctly. Maybe it's an issue with your custom color scheme or an issue with OneNote? Try bundled scheme. Try pasting it elsewhere (e.g. this forum)

P.S.
Yes -- I'm using PhpStorm and PHP code. Maybe for JS code it will behave differently (for some reason).

If you provide me a code sample (file) I may check it here on Windows 7.

0

Please sign in to leave a comment.