Presented paper describes vision-based algorithm for 2D Rubik’s cube state detection suitable for cases in which long-term fixed camera-cube position is not possible. The main focus was to provide a robust algorithm for position and color detection in order to overcome problems observed in previous version. First part of paper describes Hough transform and advanced clustering functions that were used for cube position detection. Described algorithm provides robustness to strong occlusions and various lighting conditions. Second part of paper describes color detection algorithm and problems of prior classification in various color spaces.