ankurdave / color-identifiers-mode

Emacs minor mode to highlight each source code identifier uniquely based on its name
308 stars 23 forks source link

fix srgb conversion to hex when negative numbers are involved #56

Closed jpcima closed 6 years ago

jpcima commented 6 years ago

Works around #55

The function color-rgb-to-hex raises an error when negative values are passed, on Git Emacs. In the default configuration, these negatives seem to be values under 10^-4 when they occur. Negative RGB components do not make much sense anyway, so I propose a modification to replace them with 0 values.

jpcima commented 6 years ago

Edit: using function color-clamp instead making sure to clip in both directions

ankurdave commented 6 years ago

Thanks!