Tetris/TetrisUI/Tetromino+Color.swift

32 lines
813 B
Swift

//
// 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:
return Color("TetrominoAqua", bundle: .tetrisUI)
case .o:
return Color("TetrominoYellow", bundle: .tetrisUI)
case .t:
return Color("TetrominoPurple", bundle: .tetrisUI)
case .j:
return Color("TetrominoOrange", bundle: .tetrisUI)
case .l:
return Color("TetrominoBlue", bundle: .tetrisUI)
case .s:
return Color("TetrominoRed", bundle: .tetrisUI)
case .z:
return Color("TetrominoGreen", bundle: .tetrisUI)
}
}
}