Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp32919imm; Tue, 17 Jul 2018 20:04:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcRTGwYDwcbnZfcn/exxAyY1kXJ7RfuF6u7SueTVZkMxPPQTvrQbQEbokB1DXc41r/88buM X-Received: by 2002:a62:748:: with SMTP id b69-v6mr3289046pfd.177.1531883083120; Tue, 17 Jul 2018 20:04:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531883083; cv=none; d=google.com; s=arc-20160816; b=y+hjxEj6g2KnjFnI6AgK4JFrzHmLkNFXUFzYH31x+lNiZLHPbB0qOjeMPbXLAHAvk0 lgxds0VlT/jhxaguG0SCCSbdtcSgfZHzi2SsuH7u6sEBn2zIlVPeMPeN2wzexNJrUEKj am9aaSky3jZHcmR58kaCxIiXseXPWRSK+Sfiro1RrdlbDvAQzbXUynbbPit3DDdijahb FDBFM5hq9INxceiuwmfE91tHIJQf26cYArHGruiMbTap5wOoyw4ehD2bsN/BK+s9WdO4 2bJlfA7w6P27OBQZNLp5zXXJqOnuMwk12rTTbElG+p7hC1UuA2JDSSYsklsZvCtCRPE6 d11Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=Uh97o7xLcErLR6DwcRC56Pk2mBJugVUHx72svFEJKmQ=; b=DyJmKD/+DDWyCqVAkLtdIhfceylYKJpGU4SkOTl6xylO7zyVPyCTf9h5eMnad+R2ij /PXZfVJfn3MXs8UObqDRZ2dGR61V6/lFc9T83f4gGoYgEupN6gFpElgFkiEi0Ith/kt1 s7cFDDEkOnp5ppMlgeDYy9yR5P6vlLI3BwM2cBS/qBylTKcWhjy+0DjK4JGZdT/Mxd0x yYtt/VqtmTNof6NudHbMdQ39F+mwGmGJ3Zh4QZMXbek/lzvHDhwQZnHaHKdJ33oBCZa9 EE8U9FAozIjDYz40i6sLvA/wthXjIGd9JrJf0vQwWKaMoGJipC292KBlxtElmjC0GtBc cTWQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a14-v6si2351320pfl.349.2018.07.17.20.04.28; Tue, 17 Jul 2018 20:04:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731697AbeGRDj3 (ORCPT + 99 others); Tue, 17 Jul 2018 23:39:29 -0400 Received: from tartarus.angband.pl ([89.206.35.136]:37820 "EHLO tartarus.angband.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731295AbeGRDj3 (ORCPT ); Tue, 17 Jul 2018 23:39:29 -0400 Received: from 89-71-158-145.dynamic.chello.pl ([89.71.158.145] helo=umbar.angband.pl) by tartarus.angband.pl with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ffckY-0007zL-Jp; Wed, 18 Jul 2018 05:03:44 +0200 Received: from kilobyte by umbar.angband.pl with local (Exim 4.91) (envelope-from ) id 1ffckY-0000AQ-9S; Wed, 18 Jul 2018 05:03:34 +0200 From: Adam Borowski To: Greg Kroah-Hartman , Jiri Slaby , linux-console@vger.kernel.org, Bartlomiej Zolnierkiewicz , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Adam Borowski Date: Wed, 18 Jul 2018 05:03:25 +0200 Message-Id: <20180718030327.579-4-kilobyte@angband.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180718030327.579-1-kilobyte@angband.pl> References: <20180718030152.kdq53mwpdfusvwl5@angband.pl> <20180718030327.579-1-kilobyte@angband.pl> X-SA-Exim-Connect-IP: 89.71.158.145 X-SA-Exim-Mail-From: kilobyte@angband.pl X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tartarus X-Spam-Level: X-Spam-Status: No, score=-2.9 required=8.0 tests=ALL_TRUSTED=-1,BAYES_00=-1.9, TVD_RCVD_IP=0.001 autolearn=ham autolearn_force=no languages=en Subject: [PATCH 4/6] vt: change 256-color palette to match all(?) modern terminals X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on tartarus.angband.pl) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Turns out that osso-xterm which I based upon uses something a lot different from apparently any other terminal -- they all use identical shades, much brighter than what I copied: Old: 00 2a 55 7f aa d4 New: 00 5f 87 af d7 ff This did hardly matter as we immediately shoehorn the colors into only 16 values, but recently 24-bit codes turned from an oddity to something widespread, thus it's better to handle 256 vs 24-bit consistently. Signed-off-by: Adam Borowski --- drivers/tty/vt/vt.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 4096093c8cd2..8c61caafdf3c 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -1545,9 +1545,12 @@ static void rgb_from_256(int i, struct rgb *c) c->g = i&2 ? 0xff : 0x55; c->b = i&4 ? 0xff : 0x55; } else if (i < 232) { /* 6x6x6 colour cube. */ - c->r = (i - 16) / 36 * 85 / 2; - c->g = (i - 16) / 6 % 6 * 85 / 2; - c->b = (i - 16) % 6 * 85 / 2; + int r = (i - 16) / 36; + int g = (i - 16) / 6 % 6; + int b = (i - 16) % 6; + c->r = r ? r * 0x28 + 0x37 : 0; + c->g = g ? g * 0x28 + 0x37 : 0; + c->b = b ? b * 0x28 + 0x37 : 0; } else /* Grayscale ramp. */ c->r = c->g = c->b = i * 10 - 2312; } -- 2.18.0