6
tôi nhận được lỗi này: "tài liệu tham khảo mơ hồ thành viên 'subscript" khi tôi cố gắng để thay đổi màu sắc:tham khảo mơ hồ thành viên 'subscript'
struct color {
var r : Float
var g : Float
var b : Float
}
func setPixels(image:[color], pixel: Int) {
let alpha: Float = 1.0
let pixelView = view.viewWithTag(pixel) as! UIImageView
pixelView.backgroundColor = UIColor(
red: image[pixel].r, //Error: Ambiguous reference to member 'subscript'
green: image[pixel].g,
blue: image[pixel].b,
alpha: alpha)
}