Tetris/TetrisUI/Tetromino+Color.swift

50 lines
1.4 KiB
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
}
}
2019-10-20 23:21:04 +00:00
var borderColor: Color {
switch self {
case .i:
return Color("TetrominoAquaLight", bundle: .tetrisUI)
case .o:
return Color("TetrominoYellowLight", bundle: .tetrisUI)
case .t:
return Color("TetrominoPurpleLight", bundle: .tetrisUI)
case .j:
return Color("TetrominoOrangeLight", bundle: .tetrisUI)
case .l:
return Color("TetrominoBlueLight", bundle: .tetrisUI)
case .s:
return Color("TetrominoRedLight", bundle: .tetrisUI)
case .z:
return Color("TetrominoGreenLight", bundle: .tetrisUI)
}
}
2019-10-15 21:52:16 +00:00
}