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: pauline-galea
Subject: Re: Use of cmy colour codes in Terminator
Date: Tue, 20 Apr 2021 05:53:34 +0200

I looked at some conversions but everything looks very confusing to me,
as many use percentages.  Are you sure the CMYK to RGB conversion is 
correct?

> Sent: Tuesday, April 20, 2021 at 1:45 PM
> From: "Koichi Murase" <myoga.murase@gmail.com>
> To: pauline-galea@gmx.com
> Cc: "help bash" <help-bash@gnu.org>
> Subject: Re: Use of cmy colour codes in Terminator
>
> 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]