Tetris/TetrisUI/Tetromino+Color.swift

32 lines
813 B
Swift
Raw Normal View History

2019-10-15 21:52:16 +00:00
//
// Tetromino+Color.swift
// Tetris
//
// Created by Shadowfacts on 10/15/19.
// Copyright © 2019 Shadowfacts. All rights reserved.
//
import SwiftUI
import TetrisKit
extension Tetromino {
var color: Color {
switch self {
case .i:
2019-10-17 16:06:26 +00:00
return Color("TetrominoAqua", bundle: .tetrisUI)
2019-10-15 21:52:16 +00:00
case .o:
2019-10-17 16:06:26 +00:00
return Color("TetrominoYellow", bundle: .tetrisUI)
2019-10-15 21:52:16 +00:00
case .t:
2019-10-17 16:06:26 +00:00
return Color("TetrominoPurple", bundle: .tetrisUI)
2019-10-15 21:52:16 +00:00
case .j:
2019-10-17 16:06:26 +00:00
return Color("TetrominoOrange", bundle: .tetrisUI)
2019-10-15 21:52:16 +00:00
case .l:
2019-10-17 16:06:26 +00:00
return Color("TetrominoBlue", bundle: .tetrisUI)
2019-10-15 21:52:16 +00:00
case .s:
2019-10-17 16:06:26 +00:00
return Color("TetrominoRed", bundle: .tetrisUI)
2019-10-15 21:52:16 +00:00
case .z:
2019-10-17 16:06:26 +00:00
return Color("TetrominoGreen", bundle: .tetrisUI)
2019-10-15 21:52:16 +00:00
}
}
}