2020-03-01 11:28:28 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# COMMON VARIABLES
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# PERSONAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2024-01-17 11:29:50 +01:00
|
|
|
_validate_color() {
|
|
|
|
# Remove eventual '#' prefix from color
|
|
|
|
color=${color#"#"}
|
|
|
|
# Check if the format is valid, put #555555 instead
|
|
|
|
if [[ ! "$color" =~ ^[A-Fa-f0-9]{6}$ ]]; then
|
|
|
|
color=555555
|
|
|
|
fi
|
|
|
|
echo "$color"
|
|
|
|
}
|
|
|
|
|
2020-03-01 11:28:28 +01:00
|
|
|
#=================================================
|
|
|
|
# EXPERIMENTAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# FUTURE OFFICIAL HELPERS
|
|
|
|
#=================================================
|