change colors to work in uint32 and Rgba type
This commit is contained in:
+2
-8
@@ -84,12 +84,6 @@ func HttpHandleUserNew(response http.ResponseWriter, request *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
color, err := ConvertStringToRgb(request.FormValue("color"))
|
||||
if err != nil {
|
||||
http.Error(response, "bad color", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
hashedPassword, err := PasswordHash(password)
|
||||
if err != nil {
|
||||
http.Error(response, "internal server error", http.StatusInternalServerError)
|
||||
@@ -99,7 +93,7 @@ func HttpHandleUserNew(response http.ResponseWriter, request *http.Request) {
|
||||
newUser := &User{
|
||||
Name: username,
|
||||
PasswordHash: hashedPassword,
|
||||
Color: color,
|
||||
Color: Rgba{}.GetRandom(),
|
||||
CreatedAt: time.Now(),
|
||||
}
|
||||
|
||||
@@ -149,7 +143,7 @@ func HttpHandleUserModifyAppearance(response http.ResponseWriter, request *http.
|
||||
return
|
||||
}
|
||||
|
||||
color, err := ConvertStringToRgb(request.FormValue("color"))
|
||||
color, err := ConvertStringToRgba(request.FormValue("color"))
|
||||
if err != nil {
|
||||
http.Error(response, "invalid color", http.StatusBadRequest)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user