For ye were sometimes darkness, but now are ye light in the Lord: walk as children of light:
It is as if Paul gave a list to remind us of the works of darkness in the previous verses (fornication, uncleanness, covetousness, filthiness, foolish talking, jesting, whoremonger, idolatry). He exhorts the believer to no longer partake in these sins (vs. 7), as if we were still living in darkness.
"For we ourselves also were sometimes foolish, disobedient, deceived, serving divers lusts and pleasures, living in malice and envy, hateful, and hating one another. But after that the kindness and love of God our Saviour toward man appeared, Not by works of righteousness which we have done, but according to his mercy he saved us, by the washing of regeneration, and renewing of the Holy Ghost; Which he shed on us abundantly through Jesus Christ our Saviour; That being justified by his grace, we should be made heirs according to the hope of eternal life. This is a faithful saying, and these things I will that thou affirm constantly, that they which have believed in God might be careful to maintain good works. These things are good and profitable unto men." (Titus 3:3-8)
Paul does not ignore the past, however he compares the past to the salvation and light of Jesus Christ. We were in darkness, but now that Christ has freed us from sin and darkness, we are to walk according to His light.
(For the fruit of the Spirit is in all goodness and righteousness and truth;)
Unlike the works of darkness, the fruit of the Spirit is goodness, righteousness, and truth - all attributes of our Lord Jesus Christ.
"Finally, brethren, whatsoever things are true, whatsoever things are honest, whatsoever things are just, whatsoever things are pure, whatsoever things are lovely, whatsoever things are of good report; if there be any virtue, and if there be any praise, think on these things. Those things, which ye have both learned, and received, and heard, and seen in me, do: and the God of peace shall be with you." (Philippians 4:8-9)
To now walk in this light that we've been given, we must learn more of Christ. We must cleanse our hearts to "think on these things." The fruit of the Spirit reveals the work of Christ in our lives. If we don't have these fruits, it is doubtable that we are truly walking in the Spirit.