Custom highlighting scheme

Reposted with permission: a student here at Cal Poly wasn't overwhelmingly happy with the default color schemes, came up with this one instead:

Here's the source:

edit->preferences->color->

Background tab
  Background = #1F2C33

Racket tab
  Symbol = #F48CB9
  Keyword = #ABABF9, Bold
  Comment = #F4C994
  String = #7AD37A, Italic
  Text = #33AD33
  Constant = #8BD38B
  Keyword = #F7F093
  Parenthesis = #4FD5AE
  Error = #FE0000
  Other = #FEFEFE

HtDP Languages tab
  Tests Covered = #B8FD9E
  Tests Didn't Cover =
    Foreground Color = #FE0000
    Background Color = #000000

REPL tab
  Values = #7A51E1
  Errors = #FE6565
  Output = #F28AB7

Nice!

5 Likes

fyi, color themes can be turned into installable artifacts like the info.rkts in https://pkgd.racket-lang.org/pkgn/search?tags=colorscheme

1 Like

Yep, I figured there was a way to do this, many thanks! I'll share this information with the poster.

I love being able to customize the color scheme of DrRacket.

I am partial to the Dracula scheme which can be installed from the packages list, with some slight modifications, because I really like the dracula-orange and dracula-green, which do not feature very heavily in the scheme by default:

As you can see, below, this makes artefacts like splicing operators stand out, nicely, and when I am using at-exp mode, the orange is delightful--almost reminds me of those gorgeous monochrome CRT screens with the orange or green hues.

image

2 Likes

Underlining comments isn't half bad. I kind of like it:

me too, it reminds me the time of those lovely Apple ][ amber monitors :star_struck: :


but i rarely use Racket editor directly,only for a few lines of code, i prefer Emacs or the Mac OS version of VI with the Torte color set.
In emacs it is easy to configure a custom color set ,at least for having a less aggressive background than white color, not amber but light yellow in background.(see screenshot)

I also want to use gvim , a graphical version of Vi for linux but gvim unfortunately does not display well the subscript character i use and some greek letters, for example: ηₛ and ᐁ ,they display as ? char so i can not use gvim for editing all my codes under linux.(See the screenshot below) I'am searching the solution? if someone who use gvim knows. But it works with vim in terminal (but vi in terminal is not enough modern to be used). See my dual monitor screenshot , i display Emacs top with ηₛ and ᐁ displaying well, gvim below with bad character display and vi in terminal (top right) where character are ok.
Too bad it does not works in gvim because i likes the available colors set and scheme mode, i tried a lot of police/font selection without finding one good for subscript and all the greek letters.

1 Like

That's sick, man! Almost thought it was a screenshot of Fallout :sweat_smile:

I really like your setup, thanks for sharing this. Makes me miss our first home computer.

I have not found a nice monospace font which displays subscripts and special symbols the way I would like, either. Quite a fan of terminus but it suffers from this problem.

I have resigned to using JetBrains Mono of late. Not perfect, but mostly complete.

Arranging text inside of parentheses is awesome and all, but it's a crying shame I can't press "Run" on my sheet of paper. I know jupyter is a thing: I don't yet see the matrix when writing TeX, though. Just imagine...

1 Like

I wonder why all the monochrome home computer CRTs back then were green or amber,
whereas monochrome televisions were white on dark.

-- hendrik

I can make guesses like

  • B&W brighter for fairly small devices intended to be viewed from a distance.
  • b&w film was familiar to audiences at the introduction of television.
  • coloured phosphors were more expensive to produce
  • coloured phosphors were marketed and sold but were not as popular as b&w

…but these are all guesses.

I believe that before colour film processes became widespread some B&W films were coloured manually.

This would be a great question for a film historian or specialist librarian - I bet the answer is fascinating.

S.

1 Like

Hendrik:

I wonder why all the monochrome home computer CRTs back then were green or amber,
whereas monochrome televisions were white on dark.

ChatGPT has a plausible explanation.

The green (P1) and amber (P3) phosphors used in computer CRTs had qualities that made them ideal for text readability. Green phosphor, in particular, had a high level of persistence, meaning the image lingered longer on the screen, reducing flicker and eye strain. Amber screens, introduced later, were seen as less harsh than green, which helped reduce fatigue during prolonged use.

2 Likes

LIBRARIANS:

:sweat_smile:

Checks out, though.

I was interested in the second bit. I thought everyone knew green and orange were for eyestrain.

I do wonder why most night mode modes are white on black, not green or orange on black…is it because I assumed wrong and most people don’t know that green or orange reduce eyestrain?

Yes, I see my reading comprehension is about as nuanced as a brick :brick:.

I guess, these days, I use the color temperature settings on my [device here] to adjust for the time of day, e.g., so it does not matter as much.

But, thinking about it, there is probably an interesting interplay between transmitting television signals, and projecting film in a theater.

I vaguely remember learning about the Nipkow disk at some point. I forget mechanical televisions were a thing.

1 Like

There is also the Quickscript colorscheme2package by Andre Alves Garcia

It can be installed as part of the quickscript-competition-2020 package: In DrRacket, in File>Package manager>Source, and enter quickscript-competition-2020. or with raco pkg install quickscript-competition-2020, then click Scripts>Manage scripts>Reload menu

You can also get it directly from https://github.com/Quickscript-Competiton/July2020entries/blob/master/scripts/colorscheme2package.rkt

My colour scheme is pretty terrible:

#lang info

(define deps '("base"))

(define framework:color-schemes
'(#hash(
(name . "My Color Scheme")
(white-on-black-base? . #f)
(colors
.
((framework:basic-canvas-background #(0 0 0))
 (framework:default-text-color #(255 177 0))
 (framework:disabled-background-color #(190 190 190))
 (framework:failed-search-background-color #(255 192 203))
 (framework:line-numbers #(0 0 0))
 (framework:line-numbers-current-line-number-background #(34 139 34))
 (framework:line-numbers-current-line-number-foreground #(255 255 255))
 (framework:line-numbers-when-word-wrapping #(169 169 169))
 (framework:misspelled-text-color #(255 0 0))
 (framework:paren-match-color #(0 0 0))
 (framework:program-contour-current-location-bar #(173 216 230))
 (framework:warning-background-color #(255 255 0))

(framework:syntax-color:scheme:comment #(96 255 31) )
 (framework:syntax-color:scheme:constant #(255 255 38) )
 (framework:syntax-color:scheme:error #(255 0 0) )
 (framework:syntax-color:scheme:hash-colon-keyword #(255 200 170) )
 (framework:syntax-color:scheme:keyword #(255 187 0) bold )
 (framework:syntax-color:scheme:other #(255 255 255) )
 (framework:syntax-color:scheme:parenthesis #(220 157 117) )
 (framework:syntax-color:scheme:string #(147 255 109) )
 (framework:syntax-color:scheme:symbol #(240 195 28) bold )
 (framework:syntax-color:scheme:text #(41 220 38) )
)))))

PS: More Quickscripts at https://github.com/racket/racket/wiki/Quickscript-Scripts-for-DrRacket
My favourite is Open terminal here: https://github.com/Metaxal/quickscript-extra/blob/master/scripts/open-terminal.rkt

1 Like

but Racket have already good color scheme like the one in screenshot that could be selected in Preferences:

and it support all the greek char and subscript.

about gvim i installed the JetBrains mono on my system but the linux version of gvim does not take it in account.

With MacOS all is perfect about fonts in MacVIM but not in Emacs (i cannot have the subscript chars) and with linux it is exactly the opposite...

1 Like

When I started sitting in front of a computer monitor 6+ hours a day, I had a green on black monitor. Soon I realized that after long periods in front of the monitor, the white chalk on the blackboard in my office looked pink.

I didn't think that was so good, so I got an amber on black monitor---the problem went away.

2 Likes

if i try to spent many hours at home in front of a screen, our cat, at some point will jump on the desktop and try to walk on the keyboard to have his plate of kibbles filled again :joy: forcing me to leave the computer.

being more serious and with or without cat this can help:

1 Like

With guifont=VictorMono-Regular:h12,SourceCodePro-Regular:h12,Menlo-Regular:h12, I can make "ηₛ and ᐁ" appear in MacVim. They also appear in terminal Vim (my terminal uses Victor Mono also). Perhaps your Linux text-rendering stack has some issue? I can't say.

With such a modern desktop environment like the CDE : Common Desktop Environment that i use it would be surprising :joy:

more seriously i had the same problem with Gnome and the Ubuntu system has been just installed last summer, but after your message i decided to dive in reinstalling vi , because also i believed there was some snap issue preventing vi to access all the fonts and i do not know the real cause but i can not load any font name you give or others. I try even to recompile vim from source but cannot find the source code of gvim ,in last i deinstalled vim and reinstalled it approximatively like that:

sudo apt remove vim-gui-common
sudo apt install vim-gtk3

and now the interface is a bit different and all works perfectly ,
i think some program had installed an old or different version of gvim :astonished: .

it is now good for ηₛ and ᐁ in many fonts,monospace,JetBrains,.... as the screenshot show it:

and even with CDE. :sweat_smile:

1 Like