# Bug OP-17731 - ActionView::Template::Error in ColorsController#update 

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-17731

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module | Frontend components and Primer design system |
| Target versions | 16.3.2 |
| Observed in versions | 16.3.0 |
| Sprint | 16.3.2 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 16.3.x |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | Alexander Coles |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

1.  Be an administrator

2.  Go to Admin -\> Colors
    
    1.  Either create a new color OR
    
    2.  modify an existing one

3.  Provide a an erroneous code in the "Hex code" input field:
    
    1.  use less than 6 hexadecimal characters like "\#", "\#AB", "\#ABCD", or "\#ABCDE" (note that "\#ABC" is ok and is expanded to "\#AABBCC")
    
    2.  add the leading "\#" sign multiple times like "\#\#ABCD" or "\#\#\#ABC"
    
    3.  use non hexadecimal characters without the leading "\#" like "ll" or "hello"

### What is the buggy behavior?

  - 500

### What is the expected behavior?

1.  Potentially, in the absence of a '\#' sign, just assume it to be there and be robust about it.

### **Logs**

``` text
app/models/colors/hex_color.rb:111 String#%
app/models/colors/hex_color.rb:111 Colors::HexColor#blend
app/models/colors/hex_color.rb:97 Colors::HexColor#darken
app/helpers/colors_helper.rb:130 ColorsHelper#icon_for_color
app/views/colors/_form.html.erb:46
app/views/colors/edit.html.erb:37
app/helpers/application_helper.rb:338 ApplicationHelper#labelled_tabular_form_for
app/views/colors/edit.html.erb:34
app/controllers/colors_controller.rb:86 ColorsController#update
```

<https://appsignal.com/openproject-gmbh/sites/681379ae55b0b20ed3735994/exceptions/incidents/1078>
