WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@mathematicalninja
Copy link

@mathematicalninja mathematicalninja commented Nov 26, 2025

local red_green_string = hex:sub(1, 5)
local blue_value = tonumber(hex:sub(6, 7), 16)

would read the first 5 digits as red-green and the last digit as blue

then

ans[accent] = string.format("%s%.2x", red_green_string, blue_value)

would format the 6th digit to be 2 characters wide.

So the hex_to_rgb would parse a 7-digit hex code and crash

```lua
local red_green_string = hex:sub(1, 5)
local blue_value = tonumber(hex:sub(6, 7), 16)
```

would read the first 5 digits as red-green and the last digit as blue

then
```lua 
ans[accent] = string.format("%s%.2x", red_green_string, blue_value)
```
would format the 6th digit to be 2 characters wide.

So the hex_to_rgb would parse a 7-digit hex code and crash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant