gitea/models/issues
Hester Gong ea7954f069
Modify luminance calculation and extract related functions into single files ()
Close 

Main changes:
As discussed in the issue

1. Change luminance calculation function to use [Relative
Luminance](https://www.w3.org/WAI/GL/wiki/Relative_luminance)
2. Move the luminance related functions into color.go/color.js
3. Add tests for both the files (Not sure if test cases are too many
now)

Before (tests included by `UseLightTextOnBackground` are labels started
with `##`):
https://try.gitea.io/HesterG/testrepo/labels

After:
<img width="1307" alt="Screen Shot 2023-05-08 at 13 37 55"
src="https://user-images.githubusercontent.com/17645053/236742562-fdfc3a4d-2fab-466b-9613-96f2bf96b4bc.png">
<img width="1289" alt="Screen Shot 2023-05-08 at 13 38 06"
src="https://user-images.githubusercontent.com/17645053/236742570-022db68e-cec0-43bb-888a-fc54f5332cc3.png">
<img width="1299" alt="Screen Shot 2023-05-08 at 13 38 20"
src="https://user-images.githubusercontent.com/17645053/236742572-9af1de45-fb7f-460b-828d-ba25fae20f51.png">

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
..
assignees.go Make more functions use ctx instead of db.DefaultContext ()
assignees_test.go Make more functions use ctx instead of db.DefaultContext ()
comment.go Fix issue attachment handling ()
comment_code.go some refactor about code comments ()
comment_list.go Load reviewer for comments when dismissing a review ()
comment_test.go Fix issue attachment handling ()
content_history.go Implement FSFE REUSE for golang files ()
content_history_test.go Implement FSFE REUSE for golang files ()
dependency.go Add API to manage issue dependencies ()
dependency_test.go refactor some functions to support ctx as first parameter ()
issue.go Improve milestone filter on issues page ()
issue_index.go Implement FSFE REUSE for golang files ()
issue_list.go Implement actions ()
issue_list_test.go Implement FSFE REUSE for golang files ()
issue_lock.go Rename almost all Ctx functions ()
issue_project.go Improve issues.LoadProject ()
issue_test.go Scoped labels ()
issue_user.go Implement FSFE REUSE for golang files ()
issue_user_test.go Implement FSFE REUSE for golang files ()
issue_watch.go Implement FSFE REUSE for golang files ()
issue_watch_test.go Implement FSFE REUSE for golang files ()
issue_xref.go Fix more HTMLURL in templates ()
issue_xref_test.go Make more functions use ctx instead of db.DefaultContext ()
label.go Modify luminance calculation and extract related functions into single files ()
label_test.go Modify luminance calculation and extract related functions into single files ()
main_test.go Merge setting.InitXXX into one function with options ()
milestone.go Localize milestone related time strings ()
milestone_test.go Implement FSFE REUSE for golang files ()
pull.go Refresh the refernce of the closed PR when reopening ()
pull_list.go Refresh the refernce of the closed PR when reopening ()
pull_test.go Refresh the refernce of the closed PR when reopening ()
reaction.go refactor some functions to support ctx as first parameter ()
reaction_test.go Implement FSFE REUSE for golang files ()
review.go Review fixes and enhancements ()
review_test.go Restore previous official review when an official review is deleted ()
stopwatch.go Speed up HasUserStopwatch & GetActiveStopwatch ()
stopwatch_test.go Speed up HasUserStopwatch & GetActiveStopwatch ()
tracked_time.go Rename almost all Ctx functions ()
tracked_time_test.go Use more specific test methods ()