Solar

2024-07-12

Original solarized colours:

#002b36;
#073642;
#586e75;
#657b83;
#839496;
#93a1a1;
#eee8d5;
#fdf6e3;
#b58900;
#cb4b16;
#dc322f;
#d33682;
#6c71c4;
#268bd2;
#2aa198;
#859900;

The grayish pairs are almost indistinguishable to my old eyes. In L*A*B, these are: 15 -12 -12, 20 -12 -12, 45 -7 -7, 50 -7 -7, 60 -6 -3, 65 -5 -2, 92 0 10, 97 0 10

I tried more regular spacing as per OKLCH interpolation between the two extremes, and quickly found out it’s actually useful to have a colour which is right next to the extreme, to be able to get a slightly different background.

So, here’s an attempt to take the most extreme two colours from both sides and interpolate the four in the middle, giving a better range of usable shades:

#002b36;
#073642;
#37565e;
#62797a;
#8f9c98;
#bec2b6;
#eee8d5;
#fdf6e3;

It’s a small improvement, no?


Continuing, the orig solarized colours:

#b58900;
#cb4b16;
#dc322f;
#d33682;
#6c71c4;
#268bd2;
#2aa198;
#859900;

And my tweaked version:

#a80
#c60
#d24
#c39
#77d
#28c
#2a9
#890

Tweaks mainly to better separate the red from its neighbors. Also shorthand notation, because who needs more than 4096 colours? Limiting the number of available colours lets one focus on things that matter rather than focusing on things that don’t. (The irony being that improving a colour scheme is a thing that doesn’t matter.)


Here’s a screenshot from my terminal. Left is original Solarized, right is after the changes:

solarized comparison
Interested in exploring the colours in OKLCH?

Here are the base colours in the format to paste to Huetone:

{
  "name": "solar base",
  "hues": [
    {
      "name": "color",
      "colors": [
        "#002b36",
        "#073642",
        "#37565e",
        "#62797a",
        "#8f9c98",
        "#bec2b6",
        "#eee8d5",
        "#fdf6e3"
      ]
    }
  ]
}

And the colour wheel:

{
  "name": "solar colours",
  "hues": [
    {
      "name": "color",
      "colors": [
        "#aa8800",
        "#cc6600",
        "#dd2244",
        "#cc3399",
        "#7777dd",
        "#2288cc",
        "#22aa99",
        "#889900"
      ]
    }
  ]
}

Consumption vs creation

2024-05-25

Some people think screen-time = bad. Or that smart phones = bad. I think it’s mostly creation vs consumption, no matter the medium.

Creation = good.
Comsumption = bad.

Scrolling Instagram (TikTok? whatever people use these days…) is consumption (bad). Posting on Instagram: creation (good). Checking instagram followers: consumptive (bad).

Of course it’s a spectrum. Playing computer games is more consumptive than creating them, but probably more creative than scrolling Instagram. It also depends on the particular game, playing Factorio being more creative than playing Farmville.

I’ve been doing ok recently wrt consumption vs creation, I don’t consume much and mostly spend my little free time creating. See, even now I’m creating this blog post (good). While you’re reading it (bad). Stop and go create something!

Notes on OKLCH and rainbows

2024-04-30

Colours are tricky! OKLCH is a colour space. OKLCH is better than most colour spaces in that changing the values leads to natural sensible results. But sometimes, those sensible results are not achievable because of physics, biology (eyes), and technology (display devices).

Evil Martians have a very good blog post on OKLCH. In case that goes down, MDN has a somewhat drier explanation.

The problem with the other colour spaces is that changing one of the values a certain amount leads to strange results. In HSV, changing the hue by 30 sometimes shows almost the same colour, other times an entirely different one.

In OKLCH, changing one of the values gives you nice results. Also, sometimes it gives you an inexistent colour, or a colour which is theoretically displayable, but not by your device. Oops.

Here’s an OKLCH Color Picker & Converter, go play around with it! In case it goes down, source.

I like cyclical rainbow colour palettes. I like having them consist of existing and displayable colours.

Here’s a somewhat dark one. OKLCH with Lightness 50%, Chroma 0.08 and all them hues. Anything darker, and the chroma can’t go up because of the missing cyans (and yellows). The maximum chroma that has all the colours for Lightness 50% is 0.08 – all the chromas in this post will be the maximal possible ones for the given lightness so that all the hues are still available in rgb.

Increasing Lightness to 60%, Chroma can go up to 0.1, again hitting the cyans.

The maximum chroma (for preserving all the hues) is 0.12 for Lightness 71–76%.

At lightness 85%, the purples are becoming a problem, allowing chroma of only up to 0.07 – a light saturated purple doesn’t exist. I’m so sorry.

Choosing a programming language in 2024

2024-02-22

Welp. I want to write a simple backend service and have it low maintenance for the upcoming decade. I will probably want to write other simple backend services in the upcoming decade and I’m getting old so I’d rather stick to fewer than more languages. But also I’d rather the languages to be tidy. This is a stream-of-thought for my own reference, but I might end up pushing the “publish” button anyway.

Without further ado, the contenders:

Haskell

I already wrote 30 lines of Haskell to do very simple API call forwarding, so I’m not starting from scratch here. The ergonomics just aren’t there:

  • Stack downloads a lot of things and uses exorbitant amounts of disk space. I’m running on a $5 DigitalOcean droplet!
  • With such strong typing I want an amazing IDEs but mostly end up typing things in vim.
  • Haskell is not a beautiful language. Yes it maintains backwards compatibility. Why fmap on functors and map only on lists?
  • I count six different string types and I’m trying very hard to count as few as possible. If one wanted to count as many as possible, I shudder to think what the number would be. Ideal number of string types is one.

On the plus side, stack is in my distro’s repos

PHP

Hey, I have three-ish things running PHP on the aforementioned $5 DigitalOcean droplet. Less beautiful language than Haskell, very low maintenance, just works. But hey it’s not 2004 anymore…

Python

It’s everywhere and there’s no hope of it ever going away. Its library ecosystem is amazing, its package management story is atrocious. Reads like pseudocode, but all bugs are runtime. Probably a practical choice, but is it really that much better than PHP? If I’m getting invested in another language apart from PHP, I’d like it to be nicer.

Scala

Maybe. Having worked with Scala professionally for 7 years, I know it well and like it enough. It seems to be losing a lot of steam recently, as in its cake eaten completely by the inferior Kotlin. But it’s not disappearing completely, is it? And the ecosystem of Java (and Kotlin!) libraries is there.

F#

F# is a nicer language than Scala. But it’s not that much nicer and reportedly the .NET ecosystem is worse. It’s also an ecosystem I don’t know at all. There’s ASP.NET and .NET and .NET core and .NET framework and perhaps they’re complementary or one replaces the other and the naming is confusing…

Idris and PureScript and Roc

Idris is Haskell without the warts, but no one uses Idris and it has no libraries. Nor even a package manager really.

PureScript requires a lot of imports and seems to be more of a frontend language, but perhaps I’m just being uncharitable to it. And uh JavaScript as its main compile target. It makes sense for a frontend language, of course. I use Elm and don’t complain about JavaScript being the compile target. PureScript looks real nice!

ROC is not even a thing yet.

All three a bit too much bleeding edge.

Conclusion

There is no conclusion! The only conclusion I can possibly come up with is that the nicer the language, the worse its ecosystem. The worse the language, the nicer its ecosystem. Here’s, uh, an infographic:

objective ranking of programming languages

Tiling gradients

2024-02-08

Here’s a test. A simple diagonal gradient from white to black, first full size, then four tiles of the same, and lastly sixteen tiles:

It does not tile very nicely. Neither does one which has white-black-white:

And neither white-black-white-black one:

But the following one does! White-black-white-black-white:

Then for 6, 7, and 8 it again does not tile (showing just the four tile versions):

For sequence of 9 it tiles! And sequence of 13 too! And… umm, 17 again?

Proof by induction!


I’m sure this is like some very trivial mathematics. But I do not know it. And the grayscale is a little dreary, make it pop! Let’s have three colours:

Call them purple, teal, yellow. Unsurprisingly, the three colours don’t tile when it’s purple-teal-yellow (sequence of 3), neither purple-teal-yellow-purple (sequence of 4), neither purple-teal-yellow-purple-teal (sequence of 5), neither sequence of 6:

But for sequence of 7 (purple-teal-yellow-purple-teal-yellow-purple) it tiles! Then for 13 and 19 and 25 it does too.


Uh oh, let us take four colours now. Purple, blue, green, yellow.

Green green, green green. Yellow? Yellow!

For sequence of 4 the tiling doesn’t work, but for sequence of 9 it does! And for 17 too, and 25.

This looks very much like 2n + 1


Five colours!

That’ll be 11, 21, 31, 41, 51, …

And lastly ten colours, with sequence of 21:


Why 2n + 1 ?

This is perhaps too embarassingly simple to write a blog post about, but I found none and found a lot of people on the internet confused by their gradients not aligning.

The n here is the number of different colours in your gradient. The 2n + 1 is how many colours you need to include in your code.

The +1 is simple: the last colour of the palette needs to be the same as the first, as they “touch” in the corner.

The 2n is not that difficult either: when it was n, the corners touch just fine, but the sides are shifted by half against each other, not lining up. 2n makes the sides line up, too.

Bonus time?

Here, have an animated one:

Valmorel

2024-01-21

In the nineties, when I was about ten, my parents took me to Valmorel, a ski resort in French Alps. It was my first time skiing in the Alps and I enjoyed the trip a lot. After a week of skiing, when we were leaving, I cried in the bus. My mother said don’t worry, we’d go again. But I knew this was it, there would be no other experience that could compare to going to Valmorel for the first time in my life.

Looking back, I’m surprised how correct and prescient my reaction was. There was no other Valmorel. I’d gone skiing in the Alps many times since, almost every year. It is fun. But the magic of the first time is long gone.

There will be other experiences, good and bad, repeated and unique. There will never be another Valmorel.

Pure.css

2023-01-27

I’ve been using Pure.css whenever I need to use CSS, and love it:

  • It’s tiny (about 1/10th the size of Bootstrap).
  • It’s simple. Go-read-the-code simple.
  • It gets out of the way.
  • They release about twice a year, usually adding a single feature or so. Why move fast when slow is enough?

Back in the day, I used Twitter Bootstrap for the Tsumego Collections. It’s very heavy, there’s an infinite number of classes, one has to fit in within the framework very precisely for it to work, and it requires JavaScript for the menus (???).

The main drawback of Pure.css is its ungooglability and multitude of names. The web address is purecss.io, the logo says “Pure.css”, the page title says “Pure”, the left menu shows “PURE”. I honestly have no idea what the project name actually is.

Thoughts on representing variations and commenting on them

2022-11-07

This is an exploratory post, trying to gather my thoughts on the topic and kindly requesting feedback.

I enjoy playing abstract board games: Go, TwixT, Hex, etc. I play Go on a torus board and TwixT on large boards. After playing a game, it’s helpful to be able to discuss what went right, what went wrong, and what could be improved. This is best done in the real world, but there are some wonderful facilities to do it online too. These use different ways to comment on games and show variations.

The three ways I’ve seen to comment on games and show variations/branches (do have a look at the linked examples; they’re much clearer than my explanations):

  1. The usual tree of moves (nodes) with comments on any node. Most popular, used by eg EidoGo, KGS, and Sabaki. Henceforth “tree”.
  2. A linear sequence of moves, with comments on any node creating expandable variations inline. Seen used only on GoKibitz. Henceforth “inline variations”.
  3. A linear sequence of moves, with a global linear sequence of comments. Each comment can show an arbitrary number of variations starting from any move. Seen used only on TwixT Commentator. Henceforth “global comments”.

The tree is the most ubiquitous, and I’m sure it’s the best if you want to analyze a game extremely thoroughly. The main drawback is that it’s not obvious in which order you should visit the variations and read the comments.

The inline variations allow you to go through the game and see the variations from each move as you visit it. If there are more comments by different people on these variations, they will be ordered by time and easily skimmable. I feel this is the better user experience than the tree, perhaps unless the variations are extremely numerous with a lot of branching (in which case no one will understand them anyway).

The global comments take inline variations to the extreme. It is a true conversation between people, you can see all the comments at once and choose which variations you want to explore based on the words that accompany them. I like this system a lot, though I guess it’s suited for light commentary and might fall apart for particularly heavily commented games.

Which one is the best depends on the use case. Analysing a situation to death requires different tools than two casual comments after the game. Still, I’m leaning towards the inline variations. They’re simple, and should be easy to convert to global comments, and also it should be easy to display the full tree from them. Appears to me like the most flexible solution, leaving the most doors open. (Not necessarily saying opening those doors is a good idea.)

Smiling

2022-10-22

He was smiling. An unassuming middle aged man waiting to cross a busy street with no pedestrian crossing, patiently standing by the side of the road with cars whizzing by.

In such situations my instinct is to be annoyed. Why are there so many people in cars? Can’t they take the public transport or walk? I’d like to cross already! Should I make a run for it or wait until it clears? I have other things to do, and certainly don’t want to spend my precious time standing by the road, inhaling your exhaust fumes. Why don’t they paint a crossing here?

Isn’t it unfair that this man was smiling while I’d be upset in the same situation? After some pondering, I recalled a quote by Thich Nhat Hanh:

So next time you’re stopped at a red light, you might like to sit back and practice the fourth exercise: “Breathing in, I’m aware of my body. Breathing out, I release the tension in my body.” Peace is possible at that moment, and it can be practiced many times a day – in the workplace, while you are driving, while you are cooking, while you are doing the dishes, while you are watering the vegetable garden. It is always possible to practice releasing the tension in yourself.

Perhaps it was a holy road-crosser. Perhaps he was standing there just to remind me that we can influence what we think and can decide how we feel in the situation we find ourselves in.

Oh Ubuntu

2022-10-15

I’ve been a happy Ubuntu user for 17 years, since 2005.

Ubuntu always pushes something on me I don’t want. They pushed Unity, and I hated it. Then Unity was replaced by stock Gnome and I longed for Unity. I got used to Gnome by now. It actually is pretty customizable.

Snaps. Everyone hates them. I swore I’d switch to Debian because of snaps. And yet… I’m on Ubuntu 20.04 and my neovim is old. I’d like to try a newer neovim. Well, apt remove neovim && snap install nvim. Eh, that was almost too easy?