Hi @Judge, Jacqueline ,
Good days! Welcome to Q&A forum!
Due to current platform limitations, while SharePoint allows conditional formatting using predefined CSS classes, the calendar view does not fully support applying custom colors using specific hex codes.
SharePoint's modern UI allows conditional formatting in the calendar view using specific CSS classes. These classes correspond to a set of predefined colors. For details, see: SharePoint Online CSS Classes
So our recommendation is to leverage the predefined CSS classes provided by SharePoint for conditional formatting. Although this will limit the color palette, it ensures compatibility and functionality in the calendar view.
Additionally, if this feature is important to you, we recommend that you submit feedback. This is the best platform to let us hear from you and make our products and services better for you and others. Microsoft values its customer feedback and a lot of features have been developed and suggested by customers via feedback.
If I understood something wrong, please provide more details on the matter, including the code you used. If you have questions about the answer, feel free to contact us.
And kindly consider accepting the answer if the information provided is helpful. This can assist other community members in resolving similar issues.