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
private func hsbToHSL(h: CGFloat, s: CGFloat, b: CGFloat) -> (h: CGFloat, s: CGFloat, l: CGFloat) { | |
// both hsv and hsl values are in [0, 1] | |
var newS: CGFloat = s | |
let l = (CGFloat(2) - s) * b / CGFloat(2) | |
if (l != 0) { | |
if (l == 1) { | |
newS = 0 | |
} else if (l < 0.5) { | |
newS = newS * b / (l * 2) |
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
// | |
// CustomeCameraView.swift | |
// Live Camera View | |
// | |
// Created by Vahid Sayad on 4/22/19. | |
// Copyright © 2019. All rights reserved. | |
// | |
import UIKit | |
import AVFoundation |
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
class MainActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
configureViewElements() | |
} | |
private fun configureViewElements() { | |
configureSubmitButton() |