Grail@multiverse.soulism.net to 196@lemmy.blahaj.zoneEnglish · 2 days agoI don't care what cis people think is a rule gendermultiverse.soulism.netimagemessage-square72linkfedilinkarrow-up1292arrow-down111
arrow-up1281arrow-down1imageI don't care what cis people think is a rule gendermultiverse.soulism.netGrail@multiverse.soulism.net to 196@lemmy.blahaj.zoneEnglish · 2 days agomessage-square72linkfedilink
minus-squarehumorlessrepost@lemmy.worldlinkfedilinkEnglisharrow-up6·13 hours agoIt goes against the spirit of the post, but there was a very detailed system for converting invalid colors to valid ones! If it exactly matches a recognized named color, use that color. If it is a valid three-digit legacy hex form such as #abc, expand each digit: a → aa b → bb c → cc Replace non-BMP characters with 00. Truncate the value to 128 characters. Remove a leading #, if present. Replace every character that is not an ASCII hex digit with 0. Append 0s until the length is a multiple of three. Split the result into three equal components for red, green, and blue. If each component is longer than eight characters, keep only its last eight characters. Remove leading zeroes from all three components while they remain longer than two characters. If they are still longer than two characters, truncate each to two characters. Interpret the three components as hexadecimal numbers and use them as RGB values.
It goes against the spirit of the post, but there was a very detailed system for converting invalid colors to valid ones!
If it exactly matches a recognized named color, use that color.
If it is a valid three-digit legacy hex form such as
#abc, expand each digit:Replace non-BMP characters with
00.Truncate the value to 128 characters.
Remove a leading
#, if present.Replace every character that is not an ASCII hex digit with
0.Append
0s until the length is a multiple of three.Split the result into three equal components for red, green, and blue.
If each component is longer than eight characters, keep only its last eight characters.
Remove leading zeroes from all three components while they remain longer than two characters.
If they are still longer than two characters, truncate each to two characters.
Interpret the three components as hexadecimal numbers and use them as RGB values.