Timeline for Complementary colors
Current License: CC BY-SA 3.0
18 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 1, 2016 at 22:41 | comment | added | Neil |
You don't have to fiddle around with zeros. Simply use 8**9 and you guarantee a leading 8 which you simply slice off: s=>'#'+(8**9+~('0x'+s.slice(1))).toString(16).slice(1) (54 bytes); ES6 version: s=>'#'+(~('0x'+s.slice(1))<<4>>>4).toString(16).slice(1) (56 bytes).
|
|
Jan 1, 2016 at 22:35 | comment | added | Neil | Sure, but that's now ES7. | |
Jan 1, 2016 at 9:54 | history | edited | Downgoat | CC BY-SA 3.0 |
added 45 characters in body
|
Jan 1, 2016 at 7:52 | comment | added | nderscore |
-5 bytes using 1e5 and bitflip ~ : s=>"#"+(1e5+(8**8+~('0x'+s.slice(1))).toString(16)).slice(-6)
|
|
Jan 1, 2016 at 5:04 | comment | added | NinjaBearMonkey |
You should be able to use 1e5 instead of the string of zeroes.
|
|
Jan 1, 2016 at 0:44 | history | edited | Downgoat | CC BY-SA 3.0 |
added 1 character in body
|
Jan 1, 2016 at 0:22 | comment | added | Conor O'Brien | @Doᴡɴɢᴏᴀᴛ Yeah, sorry. Noticed it when working on a Jolf answer. | |
Jan 1, 2016 at 0:22 | comment | added | Downgoat | @CᴏɴᴏʀO'Bʀɪᴇɴ thanks, didn't see that but it's fix killed the byte cubit | |
Jan 1, 2016 at 0:21 | history | edited | Downgoat | CC BY-SA 3.0 |
deleted 2 characters in body
|
Jan 1, 2016 at 0:19 | comment | added | Conor O'Brien |
Try it with the input #FFFFFF . Returns #0 .
|
|
Jan 1, 2016 at 0:18 | history | edited | Downgoat | CC BY-SA 3.0 |
i have very good spelling trust me
|
Jan 1, 2016 at 0:10 | history | edited | Downgoat | CC BY-SA 3.0 |
bug fix
|
Jan 1, 2016 at 0:09 | comment | added | Conor O'Brien | Oh, forgot about auto type casting :D | |
Jan 1, 2016 at 0:09 | comment | added | Downgoat |
@CᴏɴᴏʀO'Bʀɪᴇɴ thanks, I used - instead of eval which saved even more bytes
|
|
Jan 1, 2016 at 0:08 | history | edited | Downgoat | CC BY-SA 3.0 |
added 36 characters in body
|
Jan 1, 2016 at 0:08 | comment | added | PurkkaKoodari | @CᴏɴᴏʀO'Bʀɪᴇɴ That's the same length? | |
Jan 1, 2016 at 0:07 | comment | added | Conor O'Brien |
Use eval(`0x${s.slice(1)}`) instead of parseInt
|
|
Jan 1, 2016 at 0:04 | history | answered | Downgoat | CC BY-SA 3.0 |