[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: color-rgb-to-hex rounding / color-srgb-to-xyz typos
From: |
Lars Ingebrigtsen |
Subject: |
Re: color-rgb-to-hex rounding / color-srgb-to-xyz typos |
Date: |
Tue, 19 Jan 2021 04:37:40 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Thomas Frössman <thomasf@jossystem.se> writes:
> 1. color-rgb-to-hex rounding
>
> Hi. I was investigating why a simple color space conversion from rgb
> to lab and back via just multiplying a component with 1.0 caused
> colors to change when being converted back. The issue is that even
> tiny changes to a component float in LAB space can bring the color
> value down by 0.00000x or something in RGB and when it's converted
> back to hex it gets a surprising value.
>
> I think I propose this change making rounding optional so that it
> doesn't affect anyone who is depending on the current behaviour.
>
> (defun solarized-color-rgb-to-hex (red green blue &optional
> digits-per-component
> round)
Was this meant to be added to the solarized package, or to the in-tree
`color-rgb-to-hex' function?
> 2. typos (?) in color-srgb-to-xyz typos
>
> While looking at the issue and referencing the wikipedia sRGB page it
> seems like these values should be changed.. Doing this upset the tests
> a bit though so I didn't take it all the way because I started trying
> to understand how to actually produce test case data that is based on
> some verified numbers and not just the output of color.el's functions.
I don't know, either. Is this related to bug#41544, perhaps?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no