[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Returning hex value from rgb combination (each from 0 to 255)
From: |
Heime |
Subject: |
Re: Returning hex value from rgb combination (each from 0 to 255) |
Date: |
Sat, 31 Aug 2024 18:44:22 +0000 |
On Sunday, September 1st, 2024 at 6:24 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> > From: Vagn Johansen gonz808@hotmail.com
> > Date: Sat, 31 Aug 2024 19:54:49 +0200
> >
> > Eli Zaretskii eliz@gnu.org writes:
> >
> > > > Date: Sat, 31 Aug 2024 17:10:27 +0000
> > > > From: Heime heimeborgia@protonmail.com
> > > >
> > > > How can I make a function that takes r g and b values (from 0 to 255)
> > > > and
> > > > returns the corresponding hex value ?
> > >
> > > What is "the corresponding hex value"?
> >
> > Probably the format used by color-rgb-to-hex
> >
> > (color-rgb-to-hex 1 0 0 2) => "#ff0000"
>
>
> Then he had better used (color-rgb-to-hex 1 0 0) instead, as 2 digits
> per component will get him in trouble eventually.
But this requires values from 0.0 to 1.0 rather than from 0 to 255.