Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
たまにこういうの欲しくなる
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
You can’t perform that action at this time.