5 This is the message we have heard from Him and announce to you, that God is Light, and in Him there is no darkness at all. 6 If we say that we have fellowship with Him and yet walk in the darkness, we lie and do not practice the truth; 7 but if we walk in the Light as He Himself is in the Light, we have fellowship with one another, and the blood of Jesus His Son cleanses us from all sin. 1 John 1:5-10 (NASB) Read verses 8-10 on the site.
God is sovereign. He is Holy, Righteous, and Just. As John states in 1 John 1:5 (above), He is light, and in Him is no darkness at all.
Here is v5 from the NA28: Καὶ ἔστιν αὕτη ἡ ἀγγελία ἣν ἀκηκόαμεν ἀπʼ αὐτοῦ καὶ ἀναγγέλλομεν ὑμῖν, ὅτι ὁ θεὸς φῶς ἐστιν καὶ σκοτία ἐν αὐτῷ οὐκ ἔστιν οὐδεμία.
Here is my personal translation: “And this is the message which we have heard from Him and we declare to you, that God is light and in Him there is no darkness at all.”
The word “light” translates the Greek word φῶς (phōs), while the word “darkness” translates σκοτία (skotia) which means “darkness,” however except for John 6:17; 20:1, in the New Testament, where this word refers to the actual darkness of night or early morning, skotia is always used metaphorically. Jesus uses it to describe time of private teaching with the Twelve, away from the crowds (Matthew 10”27). He also warns against the hypocrisy of the Pharisees, saying that everything spoken in “darkness” will be revealed (Luke 12:3). Jesus is light (John 12:35), and He invites people to walk in His light instead of their darkness (John 8:12; 12:46). Those who have hatred in their hearts may think they are in the light, but they are deceived and even blinded (1 John 2:9, 11). This lost sinful world, characterized by skotia, cannot understand the light that has come to illuminate it (John 1:5). Darkness is not a power that is equal to God, for God dispels it. Light and darkness are used to contrast the purity and holiness of God and the wickedness and sinfulness of this world (1 John 1:5).