Last active
August 29, 2015 14:26
-
-
Save kamiyaowl/497b1ee02ac772a5c851 to your computer and use it in GitHub Desktop.
たまにこういうの欲しくなる
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def loopSeq = ((0 to 0xff) ++ (0x0 to 0xff).reverse) | |
val arr = {loopSeq map{x => s"{ $x, 0, 0,}, "}} ++ | |
{loopSeq map{x => s"{ 0, $x, 0,}, "}} ++ | |
{loopSeq map{x => s"{ 0, 0, $x,}, "}} ++ | |
{loopSeq map{x => s"{ $x, $x, 0,}, "}} ++ | |
{loopSeq map{x => s"{ 0, $x, $x,}, "}} ++ | |
{loopSeq map{x => s"{ $x, 0, $x,}, "}} ++ | |
{loopSeq map{x => s"{ $x, $x, $x,}, "}} | |
println(arr.mkString("uint8_t color_table[" + arr.size.toString + "][3] = {\r\n", "\r\n\t", "\r\n};")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment