help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use of cmy colour codes in Terminator


From: Koichi Murase
Subject: Re: Use of cmy colour codes in Terminator
Date: Tue, 20 Apr 2021 10:45:48 +0900

2021年4月20日(火) 9:11 <pauline-galea@gmx.com>:
> Good Morning Koichi,
>
> You must be surely right because when I tried it, I simply got the default
> colour scheme.  Do you know of algorithm to do a conversion?  I want to call
> it from my bash script or write the conversion in bash.
>
> Regards
> P

You could search for it by yourself.  It depends on the color spaces
of CMY/CMYK/RGB, i.e., the ranges of each component, gamma
corrections, etc., but with all RGBCMYK ranging from 0 to 255, I think
you can do

# CMY to RGB
R=$((~C&0xFF))
G=$((~M&0xFF))
B=$((~Y&0xFF))

# CMYK to RGB
M=$((~K&0xFF))
R=$(((~C&0xFF)*M/255))
G=$(((~M&0xFF)*M/255))
B=$(((~Y&0xFF)*M/255))

--
Koichi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]